Skip to content

Commit

Permalink
Fixed tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sergiopvilar committed Aug 22, 2015
1 parent 7e625f7 commit 8fa5b8b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test/spec/router_spec.php
Original file line number Diff line number Diff line change
Expand Up @@ -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]');

}
Expand All @@ -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]');

}
Expand Down Expand Up @@ -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']);
Expand All @@ -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']);
Expand Down

0 comments on commit 8fa5b8b

Please sign in to comment.