Adding more test suites to group DB

This commit is contained in:
Thomas Müller 2015-11-19 14:39:05 +01:00
parent 58cc3000c6
commit 1480964768
2 changed files with 30 additions and 2 deletions

View File

@ -25,6 +25,13 @@ namespace OCA\Files\Tests\Command;
use OCA\Files\Command\DeleteOrphanedFiles; use OCA\Files\Command\DeleteOrphanedFiles;
use OCP\Files\StorageNotAvailableException; use OCP\Files\StorageNotAvailableException;
/**
* Class DeleteOrphanedFilesTest
*
* @group DB
*
* @package OCA\Files\Tests\Command
*/
class DeleteOrphanedFilesTest extends \Test\TestCase { class DeleteOrphanedFilesTest extends \Test\TestCase {
/** /**

View File

@ -9,6 +9,13 @@
namespace Test\User; namespace Test\User;
/**
* Class Manager
*
* @group DB
*
* @package Test\User
*/
class Manager extends \Test\TestCase { class Manager extends \Test\TestCase {
public function testGetBackends() { public function testGetBackends() {
$userDummyBackend = $this->getMock('\Test\Util\User\Dummy'); $userDummyBackend = $this->getMock('\Test\Util\User\Dummy');
@ -441,11 +448,25 @@ class Manager extends \Test\TestCase {
} }
public function testDeleteUser() { 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 = new \Test\Util\User\Dummy();
$backend->createUser('foo', 'bar');
$manager->registerBackend($backend); $manager->registerBackend($backend);
$backend->createUser('foo', 'bar');
$this->assertTrue($manager->userExists('foo')); $this->assertTrue($manager->userExists('foo'));
$manager->get('foo')->delete(); $manager->get('foo')->delete();
$this->assertFalse($manager->userExists('foo')); $this->assertFalse($manager->userExists('foo'));