]> source.dussan.org Git - nextcloud-server.git/commitdiff
Can't use assertInstanceOf on wrapped storage; use assertTrue(instanceOfStorage(...
authorringmaster <epithet@gmail.com>
Mon, 2 Jun 2014 14:54:41 +0000 (10:54 -0400)
committerThomas Müller <thomas.mueller@tmit.eu>
Wed, 4 Jun 2014 05:55:46 +0000 (07:55 +0200)
tests/lib/files/filesystem.php
tests/lib/util.php

index 53f528af793db009a4b1bfc5b4ecbd543c974fde..930a252bcb24a1b6fe6880e42ed58d1534134e31 100644 (file)
@@ -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);
 
index 0bafb96cabd4656acd6aa4adbb1e16deaaa93dc1..aaa47f033de7d8114d818868e3c7f6359dac154a 100644 (file)
@@ -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('/');