@@ 394-425 (lines=32) @@ | ||
391 | $this->assertSame($return_one->getPath(), $return_two); |
|
392 | } |
|
393 | ||
394 | public function testCatchallImplicit() |
|
395 | { |
|
396 | $this->expectOutputString('b'); |
|
397 | ||
398 | $this->klein_app->respond( |
|
399 | '/one', |
|
400 | function () { |
|
401 | echo 'a'; |
|
402 | } |
|
403 | ); |
|
404 | $this->klein_app->respond( |
|
405 | function () { |
|
406 | echo 'b'; |
|
407 | } |
|
408 | ); |
|
409 | $this->klein_app->respond( |
|
410 | '/two', |
|
411 | function () { |
|
412 | ||
413 | } |
|
414 | ); |
|
415 | $this->klein_app->respond( |
|
416 | '/three', |
|
417 | function () { |
|
418 | echo 'c'; |
|
419 | } |
|
420 | ); |
|
421 | ||
422 | $this->klein_app->dispatch( |
|
423 | MockRequestFactory::create('/two') |
|
424 | ); |
|
425 | } |
|
426 | ||
427 | public function testCatchallAsterisk() |
|
428 | { |
|
@@ 427-459 (lines=33) @@ | ||
424 | ); |
|
425 | } |
|
426 | ||
427 | public function testCatchallAsterisk() |
|
428 | { |
|
429 | $this->expectOutputString('b'); |
|
430 | ||
431 | $this->klein_app->respond( |
|
432 | '/one', |
|
433 | function () { |
|
434 | echo 'a'; |
|
435 | } |
|
436 | ); |
|
437 | $this->klein_app->respond( |
|
438 | '*', |
|
439 | function () { |
|
440 | echo 'b'; |
|
441 | } |
|
442 | ); |
|
443 | $this->klein_app->respond( |
|
444 | '/two', |
|
445 | function () { |
|
446 | ||
447 | } |
|
448 | ); |
|
449 | $this->klein_app->respond( |
|
450 | '/three', |
|
451 | function () { |
|
452 | echo 'c'; |
|
453 | } |
|
454 | ); |
|
455 | ||
456 | $this->klein_app->dispatch( |
|
457 | MockRequestFactory::create('/two') |
|
458 | ); |
|
459 | } |
|
460 | ||
461 | public function testCatchallImplicitTriggers404() |
|
462 | { |