mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-09-08 20:42:42 +00:00
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
This commit is contained in:
parent
9122ad72f7
commit
a3f4c60139
1 changed files with 26 additions and 0 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue