diff options
Diffstat (limited to 'tests/lib')
-rw-r--r-- | tests/lib/avatartest.php | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/tests/lib/avatartest.php b/tests/lib/avatartest.php index 49e8be98c83..3d77a282a7d 100644 --- a/tests/lib/avatartest.php +++ b/tests/lib/avatartest.php @@ -60,12 +60,25 @@ class AvatarTest extends \Test\TestCase { $file = $this->getMock('\OCP\Files\File'); $file->method('getContent')->willReturn($expected->data()); - $this->folder->method('get')->with('avatar.png')->willReturn($file); + + $this->folder->method('get') + ->will($this->returnCallback( + function($path) use ($file) { + if ($path === 'avatar.png') { + return $file; + } else { + throw new \OCP\Files\NotFoundException; + } + } + )); $newFile = $this->getMock('\OCP\Files\File'); $newFile->expects($this->once()) ->method('putContent') ->with($expected2->data()); + $newFile->expects($this->once()) + ->method('getContent') + ->willReturn($expected2->data()); $this->folder->expects($this->once()) ->method('newFile') ->with('avatar.32.png') |