diff options
author | Bart Visscher <bartv@thisnet.nl> | 2013-07-18 14:24:27 -0700 |
---|---|---|
committer | Bart Visscher <bartv@thisnet.nl> | 2013-07-18 14:24:27 -0700 |
commit | 084cf0c202c2430938f5c061d8e8616dda10e2df (patch) | |
tree | 78467cf4bc8202545274d3f123527e4861928140 /tests/lib | |
parent | 279a71acb37ac373703ed05050771ef971b5d9a1 (diff) | |
parent | e2b6781cf9a97e4ad10e4824e38ccdaf3c2dc676 (diff) | |
download | nextcloud-server-084cf0c202c2430938f5c061d8e8616dda10e2df.tar.gz nextcloud-server-084cf0c202c2430938f5c061d8e8616dda10e2df.zip |
Merge pull request #2221 from owncloud/doctrine
OC6: Implement Doctrine as the backend for OC_DB
Diffstat (limited to 'tests/lib')
-rw-r--r-- | tests/lib/db.php | 4 | ||||
-rw-r--r-- | tests/lib/files/view.php | 9 |
2 files changed, 11 insertions, 2 deletions
diff --git a/tests/lib/db.php b/tests/lib/db.php index 69e3542f926..e817a2db5ed 100644 --- a/tests/lib/db.php +++ b/tests/lib/db.php @@ -37,7 +37,7 @@ class Test_DB extends PHPUnit_Framework_TestCase { $result = $query->execute(array('uri_1')); $this->assertTrue((bool)$result); $row = $result->fetchRow(); - $this->assertFalse((bool)$row); //PDO returns false, MDB2 returns null + $this->assertFalse($row); $query = OC_DB::prepare('INSERT INTO `*PREFIX*'.$this->table2.'` (`fullname`,`uri`) VALUES (?,?)'); $result = $query->execute(array('fullname test', 'uri_1')); $this->assertEquals(1, $result); @@ -94,7 +94,7 @@ class Test_DB extends PHPUnit_Framework_TestCase { $query = OC_DB::prepare('SELECT * FROM `*PREFIX*'.$this->table3.'`'); $result = $query->execute(); $this->assertTrue((bool)$result); - $this->assertEquals(4, $result->numRows()); + $this->assertEquals(4, count($result->fetchAll())); } public function testinsertIfNotExistDontOverwrite() { diff --git a/tests/lib/files/view.php b/tests/lib/files/view.php index 830913a91ad..3bac9e770aa 100644 --- a/tests/lib/files/view.php +++ b/tests/lib/files/view.php @@ -20,10 +20,19 @@ class View extends \PHPUnit_Framework_TestCase { private $storages = array(); public function setUp() { + \OC_User::clearBackends(); + \OC_User::useBackend(new \OC_User_Dummy()); + + //login + \OC_User::createUser('test', 'test'); + $this->user=\OC_User::getUser(); + \OC_User::setUserId('test'); + \OC\Files\Filesystem::clearMounts(); } public function tearDown() { + \OC_User::setUserId($this->user); foreach ($this->storages as $storage) { $cache = $storage->getCache(); $ids = $cache->getAll(); |