Skip to content

Commit

Permalink
Shrinking number of lines in dispatcher test case.
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Apr 3, 2010
1 parent 874c511 commit f605454
Showing 1 changed file with 12 additions and 27 deletions.
39 changes: 12 additions & 27 deletions cake/tests/cases/dispatcher.test.php
Expand Up @@ -1534,15 +1534,9 @@ function testAutomaticPluginControllerDispatch() {

$url = $pluginUrl;
$controller = $Dispatcher->dispatch($url, array('return' => 1));

$expected = $pluginUrl;
$this->assertIdentical($controller->plugin, $expected);

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

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

$expected = $pluginUrl;
$this->assertEqual($controller->params['controller'], $expected);
Expand All @@ -1556,15 +1550,9 @@ function testAutomaticPluginControllerDispatch() {

$url = 'admin/my_plugin/add/5/param:value/param2:value2';
$controller = $Dispatcher->dispatch($url, array('return' => 1));

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

$expected = 'MyPlugin';
$this->assertIdentical($controller->name, $expected);

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

$expected = array(0 => 5, 'param'=>'value', 'param2'=>'value2');
$this->assertEqual($controller->passedArgs, $expected);
Expand All @@ -1575,15 +1563,9 @@ function testAutomaticPluginControllerDispatch() {
$Dispatcher->base = false;

$controller = $Dispatcher->dispatch('admin/articles_test', array('return' => 1));

$expected = 'articles_test';
$this->assertIdentical($controller->plugin, $expected);

$expected = 'ArticlesTest';
$this->assertIdentical($controller->name, $expected);

$expected = 'admin_index';
$this->assertIdentical($controller->action, $expected);
$this->assertIdentical($controller->plugin, 'articles_test');
$this->assertIdentical($controller->name, 'ArticlesTest');
$this->assertIdentical($controller->action, 'admin_index');

$expected = array(
'pass'=> array(), 'named' => array(), 'controller' => 'articles_test', 'plugin' => 'articles_test', 'action' => 'admin_index',
Expand Down Expand Up @@ -1633,6 +1615,9 @@ function testAutomaticPluginDispatchWithShortAccess() {
$url = 'my_plugin/add';
$controller = $Dispatcher->dispatch($url, array('return' => 1));
$this->assertFalse(isset($controller->params['pass'][0]));
$this->assertEqual($controller->params['controller'], 'my_plugin');
$this->assertEqual($controller->params['action'], 'add');
$this->assertEqual($controller->params['plugin'], 'my_plugin');

$Dispatcher =& new TestDispatcher();
$Dispatcher->base = false;
Expand Down

0 comments on commit f605454

Please sign in to comment.