Example #1
0
 public function testGetPublishedRoutes()
 {
     $pageMock = $this->getMock('Cms\\Entity\\Page', array('getRoute'));
     $pageMock->expects($this->once())->method('getRoute')->will($this->returnValue('about'));
     $repoMock = $this->getMock('Doctrine\\ORM\\EntityRepository', array('findBy', 'getUnitOfWork'), array(), '', false);
     $repoMock->expects($this->once())->method('findBy')->will($this->returnValue(array($pageMock)));
     $this->model->setRepository($repoMock);
     $result = $this->model->getPublishedRoutes();
     $this->assertEquals(array('about'), $result);
 }