|
@@ 58-68 (lines=11) @@
|
| 55 |
|
$this->assertTrue($this->cachedParameterResolver->resolveApi()); |
| 56 |
|
} |
| 57 |
|
|
| 58 |
|
public function testResolveCriteria() |
| 59 |
|
{ |
| 60 |
|
$this->parameterResolver |
| 61 |
|
->expects($this->once()) |
| 62 |
|
->method('resolveCriteria') |
| 63 |
|
->with($this->identicalTo($mandatory = false)) |
| 64 |
|
->will($this->returnValue($criteria = ['criteria'])); |
| 65 |
|
|
| 66 |
|
$this->assertSame($criteria, $this->cachedParameterResolver->resolveCriteria($mandatory)); |
| 67 |
|
$this->assertSame($criteria, $this->cachedParameterResolver->resolveCriteria($mandatory)); |
| 68 |
|
} |
| 69 |
|
|
| 70 |
|
public function testResolveCriteriaMissing() |
| 71 |
|
{ |
|
@@ 104-114 (lines=11) @@
|
| 101 |
|
$this->assertSame($currentPage, $this->cachedParameterResolver->resolveCurrentPage()); |
| 102 |
|
} |
| 103 |
|
|
| 104 |
|
public function testResolveForm() |
| 105 |
|
{ |
| 106 |
|
$this->parameterResolver |
| 107 |
|
->expects($this->once()) |
| 108 |
|
->method('resolveForm') |
| 109 |
|
->with($this->identicalTo($resource = $this->createResourceMock())) |
| 110 |
|
->will($this->returnValue($form = 'form')); |
| 111 |
|
|
| 112 |
|
$this->assertSame($form, $this->cachedParameterResolver->resolveForm($resource)); |
| 113 |
|
$this->assertSame($form, $this->cachedParameterResolver->resolveForm($resource)); |
| 114 |
|
} |
| 115 |
|
|
| 116 |
|
public function testResolveGrid() |
| 117 |
|
{ |
|
@@ 116-126 (lines=11) @@
|
| 113 |
|
$this->assertSame($form, $this->cachedParameterResolver->resolveForm($resource)); |
| 114 |
|
} |
| 115 |
|
|
| 116 |
|
public function testResolveGrid() |
| 117 |
|
{ |
| 118 |
|
$this->parameterResolver |
| 119 |
|
->expects($this->once()) |
| 120 |
|
->method('resolveGrid') |
| 121 |
|
->with($this->identicalTo($resource = $this->createResourceMock())) |
| 122 |
|
->will($this->returnValue($grid = 'grid')); |
| 123 |
|
|
| 124 |
|
$this->assertSame($grid, $this->cachedParameterResolver->resolveGrid($resource)); |
| 125 |
|
$this->assertSame($grid, $this->cachedParameterResolver->resolveGrid($resource)); |
| 126 |
|
} |
| 127 |
|
|
| 128 |
|
public function testResolveHateoas() |
| 129 |
|
{ |
|
@@ 150-167 (lines=18) @@
|
| 147 |
|
$this->assertSame($locationRoute, $this->cachedParameterResolver->resolveLocationRoute()); |
| 148 |
|
} |
| 149 |
|
|
| 150 |
|
public function testResolveLocationRouteParameters() |
| 151 |
|
{ |
| 152 |
|
$this->parameterResolver |
| 153 |
|
->expects($this->once()) |
| 154 |
|
->method('resolveLocationRouteParameters') |
| 155 |
|
->with($this->identicalTo($object = new \stdClass())) |
| 156 |
|
->will($this->returnValue($locationRouteParameters = ['location_route_param'])); |
| 157 |
|
|
| 158 |
|
$this->assertSame( |
| 159 |
|
$locationRouteParameters, |
| 160 |
|
$this->cachedParameterResolver->resolveLocationRouteParameters($object) |
| 161 |
|
); |
| 162 |
|
|
| 163 |
|
$this->assertSame( |
| 164 |
|
$locationRouteParameters, |
| 165 |
|
$this->cachedParameterResolver->resolveLocationRouteParameters($object) |
| 166 |
|
); |
| 167 |
|
} |
| 168 |
|
|
| 169 |
|
public function testResolveMaxPerPage() |
| 170 |
|
{ |
|
@@ 224-234 (lines=11) @@
|
| 221 |
|
$this->assertTrue($this->cachedParameterResolver->resolveRedirectRouteParametersForward()); |
| 222 |
|
} |
| 223 |
|
|
| 224 |
|
public function testResolveRepositoryMethod() |
| 225 |
|
{ |
| 226 |
|
$this->parameterResolver |
| 227 |
|
->expects($this->once()) |
| 228 |
|
->method('resolveRepositoryMethod') |
| 229 |
|
->with($this->identicalTo($action = 'action')) |
| 230 |
|
->will($this->returnValue($repositoryMethod = 'repository_method')); |
| 231 |
|
|
| 232 |
|
$this->assertSame($repositoryMethod, $this->cachedParameterResolver->resolveRepositoryMethod($action)); |
| 233 |
|
$this->assertSame($repositoryMethod, $this->cachedParameterResolver->resolveRepositoryMethod($action)); |
| 234 |
|
} |
| 235 |
|
|
| 236 |
|
public function testResolveSerializerGroups() |
| 237 |
|
{ |