Skip to content

Commit

Permalink
Add test to ensure handlers that return FALSE pass request to next ma…
Browse files Browse the repository at this point in the history
…tching handler
  • Loading branch information
Luke Morton committed Feb 17, 2014
1 parent 3403a77 commit b9d5054
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions test/Lily/Test/Application/RoutedApplication.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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']);
}
}

0 comments on commit b9d5054

Please sign in to comment.