Unverified Commit a68d6313 authored by Thomas Müller's avatar Thomas Müller
Browse files

Use updateLastLoginTimestamp to properly setup lastLogin value for a test user

parent 7652e667
......@@ -86,6 +86,7 @@ class UploadTest extends RequestTest {
public function testUploadOverWriteWriteLocked() {
$user = $this->getUniqueID();
$view = $this->setupUser($user, 'pass');
$this->loginAsUser($user);
$view->file_put_contents('foo.txt', 'bar');
......
......@@ -332,8 +332,11 @@ abstract class TestCase extends \PHPUnit_Framework_TestCase {
static protected function loginAsUser($user = '') {
self::logout();
\OC\Files\Filesystem::tearDown();
\OC::$server->getConfig()->setUserValue($user, 'login', 'lastLogin', time());
\OC_User::setUserId($user);
$userObject = \OC::$server->getUserManager()->get($user);
if (!is_null($userObject)) {
$userObject->updateLastLoginTimestamp();
}
\OC_Util::setupFS($user);
if (\OC_User::userExists($user)) {
\OC::$server->getUserFolder($user);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment