Skip to content

Commit

Permalink
Moving expectations inline.
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Apr 4, 2010
1 parent ed60939 commit 87f1972
Showing 1 changed file with 10 additions and 26 deletions.
36 changes: 10 additions & 26 deletions cake/tests/cases/dispatcher.test.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -1405,11 +1405,9 @@ function testAdminDispatch() {
$Router =& Router::getInstance(); $Router =& Router::getInstance();
$controller = $Dispatcher->dispatch($url, array('return' => 1)); $controller = $Dispatcher->dispatch($url, array('return' => 1));


$expected = 'TestDispatchPages'; $this->assertEqual($controller->name, 'TestDispatchPages');
$this->assertEqual($expected, $controller->name);


$expected = array('param' => 'value', 'param2' => 'value2'); $this->assertIdentical($controller->passedArgs, array('param' => 'value', 'param2' => 'value2'));
$this->assertIdentical($expected, $controller->passedArgs);
$this->assertTrue($controller->params['admin']); $this->assertTrue($controller->params['admin']);


$expected = '/cake/repo/branches/1.2.x.x/index.php/admin/test_dispatch_pages/index/param:value/param2:value2'; $expected = '/cake/repo/branches/1.2.x.x/index.php/admin/test_dispatch_pages/index/param:value/param2:value2';
Expand Down Expand Up @@ -1452,17 +1450,10 @@ function testPluginDispatch() {


$this->assertEqual($expected, $result); $this->assertEqual($expected, $result);


$expected = 'my_plugin'; $this->assertIdentical($controller->plugin, 'my_plugin');
$this->assertIdentical($expected, $controller->plugin); $this->assertIdentical($controller->name, 'SomePages');

$this->assertIdentical($controller->params['controller'], 'some_pages');
$expected = 'SomePages'; $this->assertIdentical($controller->passedArgs, array('0' => 'home', 'param'=>'value', 'param2'=>'value2'));
$this->assertIdentical($expected, $controller->name);

$expected = 'some_pages';
$this->assertIdentical($expected, $controller->params['controller']);

$expected = array('0' => 'home', 'param'=>'value', 'param2'=>'value2');
$this->assertIdentical($expected, $controller->passedArgs);


$expected = '/cake/repo/branches/1.2.x.x/my_plugin/some_pages/home/param:value/param2:value2'; $expected = '/cake/repo/branches/1.2.x.x/my_plugin/some_pages/home/param:value/param2:value2';
$this->assertIdentical($expected, $controller->here); $this->assertIdentical($expected, $controller->here);
Expand Down Expand Up @@ -1493,17 +1484,10 @@ function testAutomaticPluginDispatch() {
$url = 'my_plugin/other_pages/index/param:value/param2:value2'; $url = 'my_plugin/other_pages/index/param:value/param2:value2';
$controller = $Dispatcher->dispatch($url, array('return' => 1)); $controller = $Dispatcher->dispatch($url, array('return' => 1));


$expected = 'my_plugin'; $this->assertIdentical($controller->plugin, 'my_plugin');
$this->assertIdentical($expected, $controller->plugin); $this->assertIdentical($controller->name, 'OtherPages');

$this->assertIdentical($controller->action, 'index');
$expected = 'OtherPages'; $this->assertIdentical($controller->passedArgs, array('param' => 'value', 'param2' => 'value2'));
$this->assertIdentical($expected, $controller->name);

$expected = 'index';
$this->assertIdentical($expected, $controller->action);

$expected = array('param' => 'value', 'param2' => 'value2');
$this->assertIdentical($expected, $controller->passedArgs);


$expected = '/cake/repo/branches/1.2.x.x/my_plugin/other_pages/index/param:value/param2:value2'; $expected = '/cake/repo/branches/1.2.x.x/my_plugin/other_pages/index/param:value/param2:value2';
$this->assertIdentical($expected, $controller->here); $this->assertIdentical($expected, $controller->here);
Expand Down

0 comments on commit 87f1972

Please sign in to comment.