From bdae057a8ed4294a41e54a366febb5560c4db3af Mon Sep 17 00:00:00 2001 From: Vyacheslav Agafonov Date: Thu, 24 Nov 2011 19:12:53 +0400 Subject: [PATCH] replace Exception on PHPUnit_Framework_Error --- app/router/Route.php | 4 ++-- tests/app/router/RouteTest.php | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/router/Route.php b/app/router/Route.php index 6a4876b..5f60df4 100644 --- a/app/router/Route.php +++ b/app/router/Route.php @@ -32,11 +32,10 @@ class Route { $parts = explode('/', $this->route); $cnt = count($parts); - if(count($request) != $cnt) { return false; } - + for ($i = 0; $i < $cnt; $i++) { if (substr($parts[$i], 0, 1) == ':') { $this->params[substr($parts[$i], 1)] = urldecode($request[$i]); @@ -52,6 +51,7 @@ class Route return false; } } + return true; } diff --git a/tests/app/router/RouteTest.php b/tests/app/router/RouteTest.php index dd21711..8e2c81c 100644 --- a/tests/app/router/RouteTest.php +++ b/tests/app/router/RouteTest.php @@ -69,7 +69,8 @@ class RouteTest extends PHPUnit_Framework_TestCase } /** - * @expectedException Exception + * @expectedException PHPUnit_Framework_Error + * @TODO Need check empty parameters from constructor Route */ public function testMatchEmptyRequest() {