Skip to content

Commit

Permalink
Update test case accordingly
Browse files Browse the repository at this point in the history
  • Loading branch information
aldeck committed Aug 18, 2014
1 parent 03205e4 commit aeb8d48
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions Tests/Binary/Loader/GridFSLoaderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'));
}
Expand All @@ -52,4 +60,3 @@ public function testFindWithInValidDocument()
$this->loader->find('0123456789abcdef01234567');
}
}

0 comments on commit aeb8d48

Please sign in to comment.