Example #1
0
 /**
  * @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');
 }
Example #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');
 }