/** * @expectedException \Lug\Bundle\ResourceBundle\Exception\RuntimeException * @expectedExceptionMessage The criteria "id" could not be found for the route "route". */ public function testResolveCriteriaMandatoryWithoutRequestCriteria() { $this->requestStack->expects($this->exactly(2))->method('getMasterRequest')->will($this->returnValue($request = $this->createRequestMock())); $request->attributes->expects($this->at(0))->method('get')->with($this->identicalTo('_lug_criteria'), $this->identicalTo([$identifier = 'id']))->will($this->returnValue([$identifier])); $request->attributes->expects($this->at(1))->method('get')->with($this->identicalTo('_route'), $this->isNull())->will($this->returnValue('route')); $request->expects($this->once())->method('get')->with($this->identicalTo($identifier), $this->isNull())->will($this->returnValue(null)); $this->parameterResolver->resolveCriteria(true); }