Browse Source

Add test for previous commit

Rachman Chavik 8 years ago
parent
commit
9ae6191dc1
1 changed files with 17 additions and 0 deletions
  1. 17 0
      tests/TestCase/Routing/RouteBuilderTest.php

+ 17 - 0
tests/TestCase/Routing/RouteBuilderTest.php

@@ -351,6 +351,23 @@ class RouteBuilderTest extends TestCase
     }
 
     /**
+     * Test creating sub-scopes with prefix()
+     *
+     * @return void
+     */
+    public function testPathWithDotInPrefix()
+    {
+        $routes = new RouteBuilder($this->collection, '/admin', ['prefix' => 'admin']);
+        $res = $routes->prefix('api', function ($r) {
+            $r->prefix('v10', ['path' => 'v1.0'], function ($r2) {
+                $this->assertEquals('/admin/api/v1.0', $r2->path());
+                $this->assertEquals(['prefix' => 'admin/api/v10'], $r2->params());
+            });
+        });
+        $this->assertNull($res);
+    }
+
+    /**
      * Test creating sub-scopes with plugin()
      *
      * @return void