From a3f4c60139eb81333b68a050ac998174d4e09b27 Mon Sep 17 00:00:00 2001 From: mark_story Date: Fri, 13 Feb 2009 19:39:52 +0000 Subject: [PATCH] Adding test case to prove #6069 git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@8030 3807eeeb-6ff5-0310-8944-8be069107fe0 --- cake/tests/cases/dispatcher.test.php | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/cake/tests/cases/dispatcher.test.php b/cake/tests/cases/dispatcher.test.php index caacd7f2e..28ebf7bad 100644 --- a/cake/tests/cases/dispatcher.test.php +++ b/cake/tests/cases/dispatcher.test.php @@ -1350,6 +1350,32 @@ class DispatcherTest extends CakeTestCase { $this->assertEqual($controller->params['named'], $expected); + Router::reload(); + $Dispatcher =& new TestDispatcher(); + $Dispatcher->base = false; + + /* Simulates the Route for a real plugin, installed in APP/plugins */ + Router::connect('/my_plugin/:controller/:action/*', array('plugin' => 'my_plugin')); + + $plugin = 'MyPlugin'; + $pluginUrl = Inflector::underscore($plugin); + + $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); + + $expected = $pluginUrl; + $this->assertEqual($controller->params['controller'], $expected); + + Configure::write('Routing.admin', 'admin'); Router::reload();