]> source.dussan.org Git - nextcloud-server.git/commitdiff
Adding more test suites to group DB
authorThomas Müller <thomas.mueller@tmit.eu>
Thu, 19 Nov 2015 13:39:05 +0000 (14:39 +0100)
committerThomas Müller <thomas.mueller@tmit.eu>
Mon, 30 Nov 2015 09:55:05 +0000 (10:55 +0100)
apps/files/tests/command/deleteorphanedfilestest.php
tests/lib/user/manager.php

index a667dba99fc1217693c4d88e327762c30a6fc124..18f568036e44dc45f3cfa17cbcc36991d949936d 100644 (file)
@@ -25,6 +25,13 @@ namespace OCA\Files\Tests\Command;
 use OCA\Files\Command\DeleteOrphanedFiles;
 use OCP\Files\StorageNotAvailableException;
 
+/**
+ * Class DeleteOrphanedFilesTest
+ *
+ * @group DB
+ *
+ * @package OCA\Files\Tests\Command
+ */
 class DeleteOrphanedFilesTest extends \Test\TestCase {
 
        /**
index df673f581c41b0e7e63934151e186a056f70c16e..90e2f67c995986172eaf04b1b7a97d6f72734e63 100644 (file)
@@ -9,6 +9,13 @@
 
 namespace Test\User;
 
+/**
+ * Class Manager
+ *
+ * @group DB
+ *
+ * @package Test\User
+ */
 class Manager extends \Test\TestCase {
        public function testGetBackends() {
                $userDummyBackend = $this->getMock('\Test\Util\User\Dummy');
@@ -441,11 +448,25 @@ class Manager extends \Test\TestCase {
        }
 
        public function testDeleteUser() {
-               $manager = new \OC\User\Manager();
+               $config = $this->getMockBuilder('OCP\IConfig')
+                       ->disableOriginalConstructor()
+                       ->getMock();
+               $config
+                               ->expects($this->at(0))
+                               ->method('getUserValue')
+                               ->with('foo', 'core', 'enabled')
+                               ->will($this->returnValue(true));
+               $config
+                               ->expects($this->at(1))
+                               ->method('getUserValue')
+                               ->with('foo', 'login', 'lastLogin')
+                               ->will($this->returnValue(0));
+
+               $manager = new \OC\User\Manager($config);
                $backend = new \Test\Util\User\Dummy();
 
-               $backend->createUser('foo', 'bar');
                $manager->registerBackend($backend);
+               $backend->createUser('foo', 'bar');
                $this->assertTrue($manager->userExists('foo'));
                $manager->get('foo')->delete();
                $this->assertFalse($manager->userExists('foo'));