| @@ 1175-1202 (lines=28) @@ | ||
| 1172 | ); |
|
| 1173 | } |
|
| 1174 | ||
| 1175 | public function testNSDispatchExternal() |
|
| 1176 | { |
|
| 1177 | $ext_namespaces = $this->loadExternalRoutes(); |
|
| 1178 | ||
| 1179 | $this->klein_app->respond( |
|
| 1180 | 404, |
|
| 1181 | function ($request, $response) { |
|
| 1182 | echo "404"; |
|
| 1183 | } |
|
| 1184 | ); |
|
| 1185 | ||
| 1186 | foreach ($ext_namespaces as $namespace) { |
|
| 1187 | ||
| 1188 | $this->assertSame( |
|
| 1189 | 'yup', |
|
| 1190 | $this->dispatchAndReturnOutput( |
|
| 1191 | MockRequestFactory::create($namespace . '/') |
|
| 1192 | ) |
|
| 1193 | ); |
|
| 1194 | ||
| 1195 | $this->assertSame( |
|
| 1196 | 'yup', |
|
| 1197 | $this->dispatchAndReturnOutput( |
|
| 1198 | MockRequestFactory::create($namespace . '/testing/') |
|
| 1199 | ) |
|
| 1200 | ); |
|
| 1201 | } |
|
| 1202 | } |
|
| 1203 | ||
| 1204 | public function testNSDispatchExternalRerequired() |
|
| 1205 | { |
|
| @@ 1204-1231 (lines=28) @@ | ||
| 1201 | } |
|
| 1202 | } |
|
| 1203 | ||
| 1204 | public function testNSDispatchExternalRerequired() |
|
| 1205 | { |
|
| 1206 | $ext_namespaces = $this->loadExternalRoutes(); |
|
| 1207 | ||
| 1208 | $this->klein_app->respond( |
|
| 1209 | 404, |
|
| 1210 | function ($request, $response) { |
|
| 1211 | echo "404"; |
|
| 1212 | } |
|
| 1213 | ); |
|
| 1214 | ||
| 1215 | foreach ($ext_namespaces as $namespace) { |
|
| 1216 | ||
| 1217 | $this->assertSame( |
|
| 1218 | 'yup', |
|
| 1219 | $this->dispatchAndReturnOutput( |
|
| 1220 | MockRequestFactory::create($namespace . '/') |
|
| 1221 | ) |
|
| 1222 | ); |
|
| 1223 | ||
| 1224 | $this->assertSame( |
|
| 1225 | 'yup', |
|
| 1226 | $this->dispatchAndReturnOutput( |
|
| 1227 | MockRequestFactory::create($namespace . '/testing/') |
|
| 1228 | ) |
|
| 1229 | ); |
|
| 1230 | } |
|
| 1231 | } |
|
| 1232 | ||
| 1233 | public function test405DefaultRequest() |
|
| 1234 | { |
|