| @@ 89-118 (lines=30) @@ | ||
| 86 | /** |
|
| 87 | * @test |
|
| 88 | */ |
|
| 89 | public function willTellTransformerToCoerceRequest() |
|
| 90 | { |
|
| 91 | $this->eventMock |
|
| 92 | ->expects($this->once()) |
|
| 93 | ->method('isMasterRequest') |
|
| 94 | ->willReturn(true); |
|
| 95 | ||
| 96 | $this->documentMock |
|
| 97 | ->expects($this->once()) |
|
| 98 | ->method('getOperationDefinition') |
|
| 99 | ->willReturn([]); |
|
| 100 | ||
| 101 | $this->repositoryMock |
|
| 102 | ->expects($this->once()) |
|
| 103 | ->method('get') |
|
| 104 | ->with(self::DOCUMENT_PATH) |
|
| 105 | ->willReturn($this->documentMock); |
|
| 106 | ||
| 107 | $this->eventMock |
|
| 108 | ->expects($this->once()) |
|
| 109 | ->method('getRequest') |
|
| 110 | ->willReturn($this->request); |
|
| 111 | ||
| 112 | $this->transformerMock |
|
| 113 | ->expects($this->once()) |
|
| 114 | ->method('process') |
|
| 115 | ->with($this->request); |
|
| 116 | ||
| 117 | $this->listener->onKernelRequest($this->eventMock); |
|
| 118 | } |
|
| 119 | ||
| 120 | /** |
|
| 121 | * @test |
|
| @@ 189-219 (lines=31) @@ | ||
| 186 | /** |
|
| 187 | * @test |
|
| 188 | */ |
|
| 189 | public function canGetOperationDefinitionUsingSwaggerPath() |
|
| 190 | { |
|
| 191 | $this->eventMock |
|
| 192 | ->expects($this->once()) |
|
| 193 | ->method('isMasterRequest') |
|
| 194 | ->willReturn(true); |
|
| 195 | ||
| 196 | $this->documentMock |
|
| 197 | ->expects($this->once()) |
|
| 198 | ->method('getOperationDefinition') |
|
| 199 | ->with(self::SWAGGER_PATH) |
|
| 200 | ->willReturn([]); |
|
| 201 | ||
| 202 | $this->repositoryMock |
|
| 203 | ->expects($this->once()) |
|
| 204 | ->method('get') |
|
| 205 | ->with(self::DOCUMENT_PATH) |
|
| 206 | ->willReturn($this->documentMock); |
|
| 207 | ||
| 208 | $this->eventMock |
|
| 209 | ->expects($this->once()) |
|
| 210 | ->method('getRequest') |
|
| 211 | ->willReturn($this->request); |
|
| 212 | ||
| 213 | $this->transformerMock |
|
| 214 | ->expects($this->once()) |
|
| 215 | ->method('process') |
|
| 216 | ->with($this->request); |
|
| 217 | ||
| 218 | $this->listener->onKernelRequest($this->eventMock); |
|
| 219 | } |
|
| 220 | } |
|
| 221 | ||