|
@@ 165-185 (lines=21) @@
|
| 162 |
|
* @expectedException \Lug\Bundle\ResourceBundle\Exception\RuntimeException |
| 163 |
|
* @expectedExceptionMessage The criteria could not be found for the route "route". |
| 164 |
|
*/ |
| 165 |
|
public function testResolveCriteriaMandatoryWithoutCriteria() |
| 166 |
|
{ |
| 167 |
|
$this->requestStack |
| 168 |
|
->expects($this->exactly(2)) |
| 169 |
|
->method('getMasterRequest') |
| 170 |
|
->will($this->returnValue($request = $this->createRequestMock())); |
| 171 |
|
|
| 172 |
|
$request->attributes |
| 173 |
|
->expects($this->at(0)) |
| 174 |
|
->method('get') |
| 175 |
|
->with($this->identicalTo('_lug_criteria'), $this->identicalTo(['id'])) |
| 176 |
|
->will($this->returnValue([])); |
| 177 |
|
|
| 178 |
|
$request->attributes |
| 179 |
|
->expects($this->at(1)) |
| 180 |
|
->method('get') |
| 181 |
|
->with($this->identicalTo('_route'), $this->isNull()) |
| 182 |
|
->will($this->returnValue('route')); |
| 183 |
|
|
| 184 |
|
$this->parameterResolver->resolveCriteria(true); |
| 185 |
|
} |
| 186 |
|
|
| 187 |
|
/** |
| 188 |
|
* @expectedException \Lug\Bundle\ResourceBundle\Exception\RuntimeException |
|
@@ 439-459 (lines=21) @@
|
| 436 |
|
* @expectedException \Lug\Bundle\ResourceBundle\Exception\RuntimeException |
| 437 |
|
* @expectedExceptionMessage The location route could not be found for the route "route". |
| 438 |
|
*/ |
| 439 |
|
public function testResolveLocationRouteMissing() |
| 440 |
|
{ |
| 441 |
|
$this->requestStack |
| 442 |
|
->expects($this->exactly(2)) |
| 443 |
|
->method('getMasterRequest') |
| 444 |
|
->will($this->returnValue($request = $this->createRequestMock())); |
| 445 |
|
|
| 446 |
|
$request->attributes |
| 447 |
|
->expects($this->at(0)) |
| 448 |
|
->method('get') |
| 449 |
|
->with($this->identicalTo('_lug_location_route'), $this->isNull()) |
| 450 |
|
->will($this->returnValue(null)); |
| 451 |
|
|
| 452 |
|
$request->attributes |
| 453 |
|
->expects($this->at(1)) |
| 454 |
|
->method('get') |
| 455 |
|
->with($this->identicalTo('_route'), $this->isNull()) |
| 456 |
|
->will($this->returnValue('route')); |
| 457 |
|
|
| 458 |
|
$this->parameterResolver->resolveLocationRoute(); |
| 459 |
|
} |
| 460 |
|
|
| 461 |
|
public function testResolveLocationRouteParametersWithoutRequest() |
| 462 |
|
{ |
|
@@ 573-593 (lines=21) @@
|
| 570 |
|
* @expectedException \Lug\Bundle\ResourceBundle\Exception\RuntimeException |
| 571 |
|
* @expectedExceptionMessage The redirect route could not be found for the route "route". |
| 572 |
|
*/ |
| 573 |
|
public function testResolveRedirectRouteMissing() |
| 574 |
|
{ |
| 575 |
|
$this->requestStack |
| 576 |
|
->expects($this->exactly(2)) |
| 577 |
|
->method('getMasterRequest') |
| 578 |
|
->will($this->returnValue($request = $this->createRequestMock())); |
| 579 |
|
|
| 580 |
|
$request->attributes |
| 581 |
|
->expects($this->at(0)) |
| 582 |
|
->method('get') |
| 583 |
|
->with($this->identicalTo('_lug_redirect_route'), $this->isNull()) |
| 584 |
|
->will($this->returnValue(null)); |
| 585 |
|
|
| 586 |
|
$request->attributes |
| 587 |
|
->expects($this->at(1)) |
| 588 |
|
->method('get') |
| 589 |
|
->with($this->identicalTo('_route'), $this->isNull()) |
| 590 |
|
->will($this->returnValue('route')); |
| 591 |
|
|
| 592 |
|
$this->parameterResolver->resolveRedirectRoute(); |
| 593 |
|
} |
| 594 |
|
|
| 595 |
|
public function testResolveRedirectRouteParametersWithoutRequest() |
| 596 |
|
{ |
|
@@ 968-988 (lines=21) @@
|
| 965 |
|
* @expectedException \Lug\Bundle\ResourceBundle\Exception\RuntimeException |
| 966 |
|
* @expectedExceptionMessage The template could not be found for the route "route". |
| 967 |
|
*/ |
| 968 |
|
public function testResolveTemplateMissing() |
| 969 |
|
{ |
| 970 |
|
$this->requestStack |
| 971 |
|
->expects($this->exactly(2)) |
| 972 |
|
->method('getMasterRequest') |
| 973 |
|
->will($this->returnValue($request = $this->createRequestMock())); |
| 974 |
|
|
| 975 |
|
$request->attributes |
| 976 |
|
->expects($this->at(0)) |
| 977 |
|
->method('get') |
| 978 |
|
->with($this->identicalTo('_lug_template'), $this->isNull()) |
| 979 |
|
->will($this->returnValue(null)); |
| 980 |
|
|
| 981 |
|
$request->attributes |
| 982 |
|
->expects($this->at(1)) |
| 983 |
|
->method('get') |
| 984 |
|
->with($this->identicalTo('_route'), $this->isNull()) |
| 985 |
|
->will($this->returnValue('route')); |
| 986 |
|
|
| 987 |
|
$this->parameterResolver->resolveTemplate(); |
| 988 |
|
} |
| 989 |
|
|
| 990 |
|
public function testResolveThemesWithoutRequest() |
| 991 |
|
{ |