Permalink
Browse files

Updating dispatcher tests to reflect changes in default plugin routes.

Removing tests for routes that have been removed.
  • Loading branch information...
1 parent e1253f0 commit 955192a4ca11f03a0a95ff59630ba01740a85a9d @markstory markstory committed Apr 11, 2010
Showing with 2 additions and 44 deletions.
  1. +2 −44 cake/tests/cases/dispatcher.test.php
@@ -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));
@@ -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');
@@ -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]);
}
/**

0 comments on commit 955192a

Please sign in to comment.