Skip to content

Commit

Permalink
Add tests for #7554
Browse files Browse the repository at this point in the history
Route generation with extensions and query parameters works just fine.
  • Loading branch information
markstory committed Oct 16, 2015
1 parent 85c8825 commit 21607e0
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/TestCase/Routing/Route/RouteTest.php
Expand Up @@ -590,6 +590,16 @@ public function testMatchWithExtension()
'_ext' => 'json',
]);
$this->assertEquals('/posts/view/1.json', $result);

$result = $route->match([
'controller' => 'posts',
'action' => 'view',
1,
'_ext' => 'json',
'id' => 'b',
'c' => 'd'
]);
$this->assertEquals('/posts/view/1.json?id=b&c=d', $result);
}

/**
Expand Down
10 changes: 10 additions & 0 deletions tests/TestCase/Routing/RouterTest.php
Expand Up @@ -1090,6 +1090,16 @@ public function testUrlGenerationWithExtensions()
]);
$expected = '/articles.json';
$this->assertEquals($expected, $result);

$result = Router::url([
'plugin' => null,
'controller' => 'articles',
'action' => 'index',
'id' => 'testing',
'_ext' => 'json'
]);
$expected = '/articles.json?id=testing';
$this->assertEquals($expected, $result);
}

/**
Expand Down

0 comments on commit 21607e0

Please sign in to comment.