]> source.dussan.org Git - nextcloud-server.git/commitdiff
Fix test
authorRobin Appelman <icewind@owncloud.com>
Mon, 19 Jan 2015 15:23:33 +0000 (16:23 +0100)
committerRobin Appelman <icewind@owncloud.com>
Mon, 13 Apr 2015 13:13:03 +0000 (15:13 +0200)
apps/files_sharing/tests/sharedstorage.php

index 14afdcf9cd436cd350871a6f37622aaa31530642..a1469a74687a92323affe38d0cb0b4ad0e005cb2 100644 (file)
@@ -397,7 +397,7 @@ class Test_Files_Sharing_Storage extends OCA\Files_sharing\Tests\TestCase {
                 * @var \OCP\Files\Storage $sharedStorage
                 */
                list($sharedStorage,) = $view->resolvePath($this->folder);
-               $this->assertInstanceOf('OCA\Files_Sharing\ISharedStorage', $sharedStorage);
+               $this->assertTrue($sharedStorage->instanceOfStorage('OCA\Files_Sharing\ISharedStorage'));
 
                $sourceStorage = new \OC\Files\Storage\Temporary(array());
                $sourceStorage->file_put_contents('foo.txt', 'asd');
@@ -405,6 +405,9 @@ class Test_Files_Sharing_Storage extends OCA\Files_sharing\Tests\TestCase {
                $sharedStorage->copyFromStorage($sourceStorage, 'foo.txt', 'bar.txt');
                $this->assertTrue($sharedStorage->file_exists('bar.txt'));
                $this->assertEquals('asd', $sharedStorage->file_get_contents('bar.txt'));
+
+               self::loginHelper(self::TEST_FILES_SHARING_API_USER1);
+               $this->view->unlink($this->folder);
        }
 
        public function testMoveFromStorage() {
@@ -423,7 +426,7 @@ class Test_Files_Sharing_Storage extends OCA\Files_sharing\Tests\TestCase {
                 * @var \OCP\Files\Storage $sharedStorage
                 */
                list($sharedStorage,) = $view->resolvePath($this->folder);
-               $this->assertInstanceOf('OCA\Files_Sharing\ISharedStorage', $sharedStorage);
+               $this->assertTrue($sharedStorage->instanceOfStorage('OCA\Files_Sharing\ISharedStorage'));
 
                $sourceStorage = new \OC\Files\Storage\Temporary(array());
                $sourceStorage->file_put_contents('foo.txt', 'asd');
@@ -431,5 +434,8 @@ class Test_Files_Sharing_Storage extends OCA\Files_sharing\Tests\TestCase {
                $sharedStorage->moveFromStorage($sourceStorage, 'foo.txt', 'bar.txt');
                $this->assertTrue($sharedStorage->file_exists('bar.txt'));
                $this->assertEquals('asd', $sharedStorage->file_get_contents('bar.txt'));
+
+               self::loginHelper(self::TEST_FILES_SHARING_API_USER1);
+               $this->view->unlink($this->folder);
        }
 }