From b9d5054e4cdd7138f64733fd63d4f2aa433b0a48 Mon Sep 17 00:00:00 2001 From: Luke Morton Date: Mon, 17 Feb 2014 01:44:40 +0000 Subject: [PATCH] Add test to ensure handlers that return FALSE pass request to next matching handler --- test/Lily/Test/Application/RoutedApplication.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/test/Lily/Test/Application/RoutedApplication.php b/test/Lily/Test/Application/RoutedApplication.php index ae6d44c..26eff68 100644 --- a/test/Lily/Test/Application/RoutedApplication.php +++ b/test/Lily/Test/Application/RoutedApplication.php @@ -3,7 +3,10 @@ namespace Lily\Test\Application; use Lily\Application\RoutedApplication; + use Lily\Mock\RoutedApplicationWithRoutes; + +use Lily\Util\Request; use Lily\Util\Response; class RoutedApplicationTest extends \PHPUnit_Framework_TestCase @@ -131,4 +134,16 @@ public function testReverseRouting() '/slug/test', $app->uri('slug', array('slug' => 'test'))); } + + public function testFalseReturnedFromHandlerPassesRequestToNextMatch() + { + $handler = + $this->routedApplicationWithoutRoutes(array( + array('GET', '/', FALSE), + array('GET', '/', array(200, array(), 'hey')), + )); + + $response = $handler(Request::get('/')); + $this->assertSame('hey', $response['body']); + } }