From: ringmaster Date: Mon, 2 Jun 2014 14:54:41 +0000 (-0400) Subject: Can't use assertInstanceOf on wrapped storage; use assertTrue(instanceOfStorage(... X-Git-Tag: v7.0.0alpha2~127^2~3 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=0e85618c429e3a33492dbd7cf7c6dadf17219926;p=nextcloud-server.git Can't use assertInstanceOf on wrapped storage; use assertTrue(instanceOfStorage() instead. --- diff --git a/tests/lib/files/filesystem.php b/tests/lib/files/filesystem.php index 53f528af793..930a252bcb2 100644 --- a/tests/lib/files/filesystem.php +++ b/tests/lib/files/filesystem.php @@ -173,7 +173,7 @@ class Filesystem extends \PHPUnit_Framework_TestCase { $homeMount = \OC\Files\Filesystem::getStorage('/' . $userId . '/'); - $this->assertInstanceOf('\OC\Files\Storage\Local', $homeMount); + $this->assertTrue($homeMount->instanceOfStorage('\OC\Files\Storage\Local')); $this->assertEquals('local::' . $datadir . '/' . $userId . '/', $homeMount->getId()); } @@ -189,7 +189,7 @@ class Filesystem extends \PHPUnit_Framework_TestCase { $homeMount = \OC\Files\Filesystem::getStorage('/' . $userId . '/'); - $this->assertInstanceOf('\OC\Files\Storage\Home', $homeMount); + $this->assertTrue($homeMount->instanceOfStorage('\OC\Files\Storage\Home')); $this->assertEquals('home::' . $userId, $homeMount->getId()); \OC_User::deleteUser($userId); @@ -214,7 +214,7 @@ class Filesystem extends \PHPUnit_Framework_TestCase { $homeMount = \OC\Files\Filesystem::getStorage('/' . $userId . '/'); - $this->assertInstanceOf('\OC\Files\Storage\Home', $homeMount); + $this->assertTrue($homeMount->instanceOfStorage('\OC\Files\Storage\Home')); $this->assertEquals('local::' . $datadir . '/' . $userId . '/', $homeMount->getId()); \OC_User::deleteUser($userId); @@ -244,7 +244,7 @@ class Filesystem extends \PHPUnit_Framework_TestCase { \OC\Files\Filesystem::getMountPoint('/' . $userId . '/cache') ); list($storage, $internalPath) = \OC\Files\Filesystem::resolvePath('/' . $userId . '/cache'); - $this->assertInstanceOf('\OC\Files\Storage\Home', $storage); + $this->assertTrue($storage->instanceOfStorage('\OC\Files\Storage\Home')); $this->assertEquals('cache', $internalPath); \OC_User::deleteUser($userId); @@ -271,7 +271,7 @@ class Filesystem extends \PHPUnit_Framework_TestCase { \OC\Files\Filesystem::getMountPoint('/' . $userId . '/cache') ); list($storage, $internalPath) = \OC\Files\Filesystem::resolvePath('/' . $userId . '/cache'); - $this->assertInstanceOf('\OC\Files\Storage\Local', $storage); + $this->assertTrue($storage->instanceOfStorage('\OC\Files\Storage\Local')); $this->assertEquals('', $internalPath); \OC_User::deleteUser($userId); diff --git a/tests/lib/util.php b/tests/lib/util.php index 0bafb96cabd..aaa47f033de 100644 --- a/tests/lib/util.php +++ b/tests/lib/util.php @@ -154,7 +154,7 @@ class Test_Util extends PHPUnit_Framework_TestCase { $userMount = \OC\Files\Filesystem::getMountManager()->find('/' . $user1 . '/'); $this->assertNotNull($userMount); - $this->assertInstanceOf('\OC\Files\Storage\Wrapper\Quota', $userMount->getStorage()); + $this->assertTrue($userMount->getStorage()->instanceOfStorage('\OC\Files\Storage\Wrapper\Quota')); // ensure that root wasn't wrapped $rootMount = \OC\Files\Filesystem::getMountManager()->find('/');