Beispiel #1
0
 public function testRepositorySetup()
 {
     // Rather than injecting a repo, inject an EM that can try to make one
     $repoMock = $this->getMock('Doctrine\\ORM\\EntityRepository', array('find', 'getUnitOfWork'), array(), '', false);
     $emMock = $this->getEmMock();
     $emMock->expects($this->once())->method('getRepository')->will($this->returnValue($repoMock));
     $this->model->setEntityManager($emMock);
     $repo = $this->model->getRepository();
     // For some reason these are not the same
     //echo "\n" . get_class($repoMock) . "\n" . get_class($repo) . "\n";die;
     //$this->assertSame($repoMock, $repo);
 }