Skip to content

Commit

Permalink
Updating dispatcher tests to reflect changes in default plugin routes.
Browse files Browse the repository at this point in the history
Removing tests for routes that have been removed.
  • Loading branch information
markstory committed Apr 11, 2010
1 parent e1253f0 commit 955192a
Showing 1 changed file with 2 additions and 44 deletions.
46 changes: 2 additions & 44 deletions cake/tests/cases/dispatcher.test.php
Expand Up @@ -1517,7 +1517,7 @@ function testAutomaticPluginControllerDispatch() {
$Dispatcher =& new TestDispatcher();
$Dispatcher->base = false;

$url = 'my_plugin/add/param:value/param2:value2';
$url = 'my_plugin/my_plugin/add/param:value/param2:value2';

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

Expand Down Expand Up @@ -1553,7 +1553,7 @@ function testAutomaticPluginControllerDispatch() {
$Dispatcher =& new TestDispatcher();
$Dispatcher->base = false;

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

$this->assertEqual($controller->params['plugin'], 'my_plugin');
Expand Down Expand Up @@ -1621,48 +1621,6 @@ function testAutomaticPluginDispatchWithShortAccess() {
$this->assertEqual($controller->params['plugin'], 'my_plugin');
$this->assertEqual($controller->params['action'], 'index');
$this->assertFalse(isset($controller->params['pass'][0]));

$url = 'my_plugin/my_plugin/add';
$controller = $Dispatcher->dispatch($url, array('return' => 1));
$this->assertFalse(isset($controller->params['pass'][0]));

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

$url = 'my_plugin/my_plugin/add/0';
$controller = $Dispatcher->dispatch($url, array('return' => 1));
$this->assertTrue(isset($controller->params['pass'][0]));

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

$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;

$url = 'my_plugin/add/0';
$controller = $Dispatcher->dispatch($url, array('return' => 1));
$this->assertEqual($controller->params['controller'], 'my_plugin');
$this->assertEqual($controller->params['plugin'], 'my_plugin');
$this->assertEqual($controller->params['action'], 'add');
$this->assertIdentical('0', $controller->params['pass'][0]);

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

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

$this->assertEqual($controller->params['controller'], 'my_plugin');
$this->assertEqual($controller->params['plugin'], 'my_plugin');
$this->assertEqual($controller->params['action'], 'add');
$this->assertIdentical('1', $controller->params['pass'][0]);
}

/**
Expand Down

0 comments on commit 955192a

Please sign in to comment.