/** * @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'); }
/** * @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'); }