|
@@ 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 |
|
{ |
|
@@ 931-951 (lines=21) @@
|
| 928 |
|
* @expectedException \Lug\Bundle\ResourceBundle\Exception\RuntimeException |
| 929 |
|
* @expectedExceptionMessage The template could not be found for the route "route". |
| 930 |
|
*/ |
| 931 |
|
public function testResolveTemplateMissing() |
| 932 |
|
{ |
| 933 |
|
$this->requestStack |
| 934 |
|
->expects($this->exactly(2)) |
| 935 |
|
->method('getMasterRequest') |
| 936 |
|
->will($this->returnValue($request = $this->createRequestMock())); |
| 937 |
|
|
| 938 |
|
$request->attributes |
| 939 |
|
->expects($this->at(0)) |
| 940 |
|
->method('get') |
| 941 |
|
->with($this->identicalTo('_lug_template'), $this->isNull()) |
| 942 |
|
->will($this->returnValue(null)); |
| 943 |
|
|
| 944 |
|
$request->attributes |
| 945 |
|
->expects($this->at(1)) |
| 946 |
|
->method('get') |
| 947 |
|
->with($this->identicalTo('_route'), $this->isNull()) |
| 948 |
|
->will($this->returnValue('route')); |
| 949 |
|
|
| 950 |
|
$this->parameterResolver->resolveTemplate(); |
| 951 |
|
} |
| 952 |
|
|
| 953 |
|
public function testResolveThemesWithoutRequest() |
| 954 |
|
{ |