diff options
author | Robin Appelman <icewind@owncloud.com> | 2016-02-18 15:41:10 +0100 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2016-03-23 17:13:21 +0100 |
commit | f77ce8829c32a6258c1d18d833066636bff52179 (patch) | |
tree | 0de2490f5e2e7062c20bcfce9eb65184b0063ec0 /tests | |
parent | 70a5233f697d27a24e51c8be239dfcf36b1d9b9d (diff) | |
download | nextcloud-server-f77ce8829c32a6258c1d18d833066636bff52179.tar.gz nextcloud-server-f77ce8829c32a6258c1d18d833066636bff52179.zip |
pass the fileinfo to the node if available
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lib/files/node/folder.php | 8 | ||||
-rw-r--r-- | tests/lib/files/node/root.php | 15 |
2 files changed, 8 insertions, 15 deletions
diff --git a/tests/lib/files/node/folder.php b/tests/lib/files/node/folder.php index 09bf32561e6..06ca35f7f11 100644 --- a/tests/lib/files/node/folder.php +++ b/tests/lib/files/node/folder.php @@ -601,8 +601,8 @@ class Folder extends \Test\TestCase { $cache = $this->getMock('\OC\Files\Cache\Cache', array(), array('')); $view->expects($this->once()) - ->method('file_exists') - ->will($this->returnValue(true)); + ->method('getFileInfo') + ->will($this->returnValue(new FileInfo('/bar/foo/qwerty', null, 'qwerty', [], null))); $storage->expects($this->once()) ->method('getCache') @@ -683,8 +683,8 @@ class Folder extends \Test\TestCase { $cache = $this->getMock('\OC\Files\Cache\Cache', array(), array('')); $view->expects($this->any()) - ->method('file_exists') - ->will($this->returnValue(true)); + ->method('getFileInfo') + ->will($this->returnValue(new FileInfo('/bar/foo/qwerty', null, 'qwerty', [], null))); $storage->expects($this->any()) ->method('getCache') diff --git a/tests/lib/files/node/root.php b/tests/lib/files/node/root.php index 4b1aea1da4e..9c77959869d 100644 --- a/tests/lib/files/node/root.php +++ b/tests/lib/files/node/root.php @@ -12,6 +12,9 @@ use OC\Files\FileInfo; use OCP\Files\NotPermittedException; use OC\Files\Mount\Manager; +/** + * @group DB + */ class Root extends \Test\TestCase { private $user; @@ -41,16 +44,6 @@ class Root extends \Test\TestCase { ->with('/bar/foo') ->will($this->returnValue($this->getFileInfo(array('fileid' => 10, 'path' => 'bar/foo', 'name', 'mimetype' => 'text/plain')))); - $view->expects($this->once()) - ->method('is_dir') - ->with('/bar/foo') - ->will($this->returnValue(false)); - - $view->expects($this->once()) - ->method('file_exists') - ->with('/bar/foo') - ->will($this->returnValue(true)); - $root->mount($storage, ''); $node = $root->get('/bar/foo'); $this->assertEquals(10, $node->getId()); @@ -73,7 +66,7 @@ class Root extends \Test\TestCase { $root = new \OC\Files\Node\Root($manager, $view, $this->user); $view->expects($this->once()) - ->method('file_exists') + ->method('getFileInfo') ->with('/bar/foo') ->will($this->returnValue(false)); |