public function testFindAll() { $repoMock = $this->getMock('Doctrine\\ORM\\EntityRepository', array('findBy', 'getUnitOfWork'), array(), '', false); $repoMock->expects($this->once())->method('findBy')->will($this->returnValue('placeholder')); $this->model->setRepository($repoMock); $this->model->setEntityManager($this->getEmMock()); $result = $this->model->findAll(); $this->assertEquals('placeholder', $result); }