| @@ 154-170 (lines=17) @@ | ||
| 151 | /** |
|
| 152 | * @test |
|
| 153 | */ |
|
| 154 | public function routeCollectionWillIncludeSeparateRoutesForSubPaths() |
|
| 155 | { |
|
| 156 | $pathDefinitions = (object)[ |
|
| 157 | '/a' => (object)['get' => (object)[]], |
|
| 158 | '/a/b' => (object)['get' => (object)[]], |
|
| 159 | '/a/b/c' => (object)['get' => (object)[]], |
|
| 160 | ]; |
|
| 161 | ||
| 162 | $this->documentMock |
|
| 163 | ->expects($this->once()) |
|
| 164 | ->method('getPathDefinitions') |
|
| 165 | ->willReturn($pathDefinitions); |
|
| 166 | ||
| 167 | $routes = $this->loader->load(self::DOCUMENT_PATH); |
|
| 168 | ||
| 169 | $this->assertCount(3, $routes); |
|
| 170 | } |
|
| 171 | ||
| 172 | /** |
|
| 173 | * @test |
|
| @@ 201-217 (lines=17) @@ | ||
| 198 | /** |
|
| 199 | * @test |
|
| 200 | */ |
|
| 201 | public function routeCollectionWillIncludeSeparateRoutesForSubPathMethodCombinations() |
|
| 202 | { |
|
| 203 | $pathDefinitions = (object)[ |
|
| 204 | '/a' => (object)['get' => (object)[]], |
|
| 205 | '/a/b' => (object)['get' => (object)[], 'post' => (object)[]], |
|
| 206 | '/a/b/c' => (object)['put' => (object)[]], |
|
| 207 | ]; |
|
| 208 | ||
| 209 | $this->documentMock |
|
| 210 | ->expects($this->once()) |
|
| 211 | ->method('getPathDefinitions') |
|
| 212 | ->willReturn($pathDefinitions); |
|
| 213 | ||
| 214 | $routes = $this->loader->load(self::DOCUMENT_PATH); |
|
| 215 | ||
| 216 | $this->assertCount(4, $routes); |
|
| 217 | } |
|
| 218 | ||
| 219 | /** |
|
| 220 | * @test |
|