/** * Find by id */ public function testFind() { $repoMock = $this->getMock('Doctrine\\ORM\\EntityRepository', array('find', 'getUnitOfWork'), array(), '', false); $repoMock->expects($this->once())->method('find')->with($this->equalTo(5))->will($this->returnValue('placeholder')); $this->model->setRepository($repoMock); $this->model->setEntityManager($this->getEmMock()); $result = $this->model->find(5); $this->assertEquals('placeholder', $result); }