From 8fa5b8b879f7e3848ebbb47b870d56f9cb256c9b Mon Sep 17 00:00:00 2001 From: Sergio Vilar Date: Sat, 22 Aug 2015 00:31:41 -0300 Subject: [PATCH] Fixed tests --- test/spec/router_spec.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/spec/router_spec.php b/test/spec/router_spec.php index 2da01d9..4b96af6 100644 --- a/test/spec/router_spec.php +++ b/test/spec/router_spec.php @@ -109,7 +109,7 @@ function test_route_with_one_parameter() { $this->assertCount(0, $target['middlewares']); $this->assertCount(1, $target['params']); $this->assertEquals($target['params'][0], 'model'); - $this->assertEquals($target['regex'], 'car/([a-zA-Z0-9]+)/?'); + $this->assertEquals($target['regex'], 'car/([a-zA-Z0-9-]+)/?'); $this->assertEquals($target['qstring'], 'index.php?amp_route='.$id.'&model=$matches[1]'); } @@ -126,7 +126,7 @@ function test_route_with_two_parameters() { $this->assertCount(2, $target['params']); $this->assertEquals($target['params'][0], 'model'); $this->assertEquals($target['params'][1], 'year'); - $this->assertEquals($target['regex'], 'bike/([a-zA-Z0-9]+)/([a-zA-Z0-9]+)/?'); + $this->assertEquals($target['regex'], 'bike/([a-zA-Z0-9-]+)/([a-zA-Z0-9-]+)/?'); $this->assertEquals($target['qstring'], 'index.php?amp_route='.$id.'&model=$matches[1]&year=$matches[2]'); } @@ -227,7 +227,7 @@ function test_group_of_routes_with_parameters() { $target = Route::getRoutes()[0]; $id = str_replace('=', '', base64_encode('GET/admin/dashboard/:section')); - $this->assertEquals($target['regex'], 'admin/dashboard/([a-zA-Z0-9]+)/?'); + $this->assertEquals($target['regex'], 'admin/dashboard/([a-zA-Z0-9-]+)/?'); $this->assertEquals($target['method'], 'GET'); $this->assertEquals($target['id'], $id); $this->assertCount(0, $target['middlewares']); @@ -245,7 +245,7 @@ function test_group_of_routes_with_parameters_in_the_group() { $target = Route::getRoutes()[0]; $id = str_replace('=', '', base64_encode('GET/admin/:section/dashboard')); - $this->assertEquals($target['regex'], 'admin/([a-zA-Z0-9]+)/dashboard/?'); + $this->assertEquals($target['regex'], 'admin/([a-zA-Z0-9-]+)/dashboard/?'); $this->assertEquals($target['method'], 'GET'); $this->assertEquals($target['id'], $id); $this->assertCount(0, $target['middlewares']);