Skip to content
Permalink
Browse files

New test without $params.

  • Loading branch information...
andretefras committed Oct 23, 2016
1 parent f07504e commit 5d4757ce8d86502e88d4308d8209466be82cd556
Showing with 18 additions and 1 deletion.
  1. +18 −1 tests/TestCase/Routing/RouteBuilderTest.php
@@ -306,7 +306,24 @@ public function testRedirect()
public function testPrefix()
{
$routes = new RouteBuilder($this->collection, '/path', ['key' => 'value']);
$res = $routes->prefix('admin', ['key' => 'value'], function ($r) {
$res = $routes->prefix('admin', ['param' => 'value'], function ($r) {
$this->assertInstanceOf('Cake\Routing\RouteBuilder', $r);
$this->assertCount(0, $this->collection->routes());
$this->assertEquals('/path/admin', $r->path());
$this->assertEquals(['prefix' => 'admin', 'key' => 'value', 'param' => 'value'], $r->params());
});
$this->assertNull($res);
}
/**
* Test creating sub-scopes with prefix()
*
* @return void
*/
public function testPrefixWithNoParams()
{
$routes = new RouteBuilder($this->collection, '/path', ['key' => 'value']);
$res = $routes->prefix('admin', function ($r) {
$this->assertInstanceOf('Cake\Routing\RouteBuilder', $r);
$this->assertCount(0, $this->collection->routes());
$this->assertEquals('/path/admin', $r->path());

0 comments on commit 5d4757c

Please sign in to comment.
You can’t perform that action at this time.