コード例 #1
0
ファイル: ContentRouterTest.php プロジェクト: Opifer/Cms
 /**
  * @expectedException \Symfony\Component\Routing\Exception\ResourceNotFoundException
  */
 public function testNotMatch()
 {
     $contentRepository = m::mock('Opifer\\ContentBundle\\Model\\ContentRepository');
     $this->contentManager->shouldReceive('getRepository')->andReturn($contentRepository);
     $contentRepository->shouldReceive('findActiveBySlug', 'findActiveByAlias')->andThrow('Doctrine\\ORM\\NoResultException');
     $contentRouter = new ContentRouter($this->requestStack, $this->contentManager);
     $result = $contentRouter->match('/about');
 }
コード例 #2
0
 /**
  * @expectedException \Symfony\Component\Routing\Exception\ResourceNotFoundException
  */
 public function testNotMatch()
 {
     $this->contentManager->shouldReceive('findActiveBySlug', 'findActiveByAlias')->andThrow('Doctrine\\ORM\\NoResultException');
     $contentRouter = new ContentRouter($this->requestStack, $this->contentManager);
     $result = $contentRouter->match('/about');
 }