Updating fatal tests in Dispatcher tests. Updating Router to use a method instead of a raw array_merge.

This commit is contained in:
Mark Story 2010-05-01 11:07:32 -04:00
parent 0a7ba707b6
commit 2b08ad6012
2 changed files with 5 additions and 6 deletions

View file

@ -486,8 +486,7 @@ class Router {
$out['url']['ext'] = $ext;
}
$request->params = array_merge($request->params, $out);
$request->addParams($out);
return $request;
}

View file

@ -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']);