From aeb8d48bb13e44d996b06b01642b4a2309db698a Mon Sep 17 00:00:00 2001 From: Alexandre Deckner Date: Mon, 18 Aug 2014 18:41:13 +0200 Subject: [PATCH] Update test case accordingly --- Tests/Binary/Loader/GridFSLoaderTest.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Tests/Binary/Loader/GridFSLoaderTest.php b/Tests/Binary/Loader/GridFSLoaderTest.php index 627afb4be..8644ca70b 100644 --- a/Tests/Binary/Loader/GridFSLoaderTest.php +++ b/Tests/Binary/Loader/GridFSLoaderTest.php @@ -37,7 +37,15 @@ public function testFindWithValidDocument() $image = new GridFSFile(); $image->setBytes('01010101'); - $this->repo->expects($this->atLeastOnce())->method('find')->with($this->isInstanceOf('\MongoId'))->will($this->returnValue(array('file'=>$image))); + $imageDocument = $this->getMock('ImageDocument', array('getFile')); + $imageDocument + ->expects($this->any()) + ->method('getFile') + ->with() + ->will($this->returnValue($image)) + ; + + $this->repo->expects($this->atLeastOnce())->method('find')->with($this->isInstanceOf('\MongoId'))->will($this->returnValue($imageDocument)); $this->assertEquals('01010101', $this->loader->find('0123456789abcdef01234567')); } @@ -52,4 +60,3 @@ public function testFindWithInValidDocument() $this->loader->find('0123456789abcdef01234567'); } } - \ No newline at end of file