From b93e5c13ea6e12fe6c0420a4a839b4aad2dd83b7 Mon Sep 17 00:00:00 2001 From: nate Date: Wed, 23 Jan 2008 16:09:27 +0000 Subject: [PATCH] Adding tests for routes with UUID matches, closes #3973 (disproven) git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6405 3807eeeb-6ff5-0310-8944-8be069107fe0 --- cake/tests/cases/libs/router.test.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/cake/tests/cases/libs/router.test.php b/cake/tests/cases/libs/router.test.php index 4c1ad0115..17c083f32 100644 --- a/cake/tests/cases/libs/router.test.php +++ b/cake/tests/cases/libs/router.test.php @@ -601,6 +601,18 @@ class RouterTest extends UnitTestCase { } + function testUuidRoutes() { + $this->router->reload(); + $this->router->connect( + '/subjects/add/:category_id', + array('controller' => 'subjects', 'action' => 'add'), + array('category_id' => '\w{8}-\w{4}-\w{4}-\w{4}-\w{12}') + ); + $result = $this->router->parse('/subjects/add/4795d601-19c8-49a6-930e-06a8b01d17b7'); + $expected = array('pass' => array(), 'named' => array(), 'category_id' => '4795d601-19c8-49a6-930e-06a8b01d17b7', 'plugin' => null, 'controller' => 'subjects', 'action' => 'add'); + $this->assertEqual($result, $expected); + } + function testRouteSymmetry() { $this->router->reload();