From 7c50eb7cfb13e288dec2b1cd0db434e402752564 Mon Sep 17 00:00:00 2001 From: Mike Cao Date: Wed, 5 Nov 2014 21:03:52 -0800 Subject: [PATCH] Passing to a non-matching route should return a 404. --- VERSION | 2 +- flight/Engine.php | 2 ++ tests/RouterTest.php | 6 +++--- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/VERSION b/VERSION index db6fb4a..9d4f823 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.2.8 +1.2.9 diff --git a/flight/Engine.php b/flight/Engine.php index ce82d41..567ef6e 100644 --- a/flight/Engine.php +++ b/flight/Engine.php @@ -316,6 +316,8 @@ class Engine { if (!$continue) break; $router->next(); + + $dispatched = false; } if (!$dispatched) { diff --git a/tests/RouterTest.php b/tests/RouterTest.php index 3ff7b7b..0dca312 100644 --- a/tests/RouterTest.php +++ b/tests/RouterTest.php @@ -148,8 +148,8 @@ class RouterTest extends PHPUnit_Framework_TestCase $this->check('OK'); } - // Check if route was passed - function testRoutePassing(){ + // Check if route object was passed + function testRouteObjectPassing(){ $this->router->map('/yes_route', function($route){ $this->assertTrue(is_object($route)); }, @@ -186,7 +186,7 @@ class RouterTest extends PHPUnit_Framework_TestCase $this->request->url = '/account'; - $this->check(''); + $this->check(); } // Test splat with named parameters