From 2b08ad6012ac951e6a8a942adbe7bffefd7827d5 Mon Sep 17 00:00:00 2001 From: Mark Story Date: Sat, 1 May 2010 11:07:32 -0400 Subject: [PATCH] Updating fatal tests in Dispatcher tests. Updating Router to use a method instead of a raw array_merge. --- cake/libs/router.php | 3 +-- cake/tests/cases/dispatcher.test.php | 8 ++++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/cake/libs/router.php b/cake/libs/router.php index 3bc1e6b24..e13d7504a 100644 --- a/cake/libs/router.php +++ b/cake/libs/router.php @@ -486,8 +486,7 @@ class Router { $out['url']['ext'] = $ext; } - $request->params = array_merge($request->params, $out); - + $request->addParams($out); return $request; } diff --git a/cake/tests/cases/dispatcher.test.php b/cake/tests/cases/dispatcher.test.php index 09d63ef88..30c08a737 100644 --- a/cake/tests/cases/dispatcher.test.php +++ b/cake/tests/cases/dispatcher.test.php @@ -679,16 +679,16 @@ class DispatcherTest extends CakeTestCase { Router::connect('/pages/*', array('controller' => 'pages', 'action' => 'display')); $_GET = array('coffee' => 'life', 'sleep' => 'sissies'); - $Dispatcher =& new Dispatcher(); - $uri = 'posts/home/?coffee=life&sleep=sissies'; + $Dispatcher = new Dispatcher(); + $uri = new CakeRequest('posts/home/?coffee=life&sleep=sissies'); $result = $Dispatcher->parseParams($uri); $this->assertPattern('/posts/', $result['controller']); $this->assertPattern('/home/', $result['action']); $this->assertTrue(isset($result['url']['sleep'])); $this->assertTrue(isset($result['url']['coffee'])); - $Dispatcher =& new Dispatcher(); - $uri = '/?coffee=life&sleep=sissy'; + $Dispatcher = new Dispatcher(); + $uri = new CakeRequest('/?coffee=life&sleep=sissy'); $result = $Dispatcher->parseParams($uri); $this->assertPattern('/pages/', $result['controller']); $this->assertPattern('/display/', $result['action']);