mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 09:06:17 +00:00
Merge branch '1.3' of github.com:cakephp/cakephp1x into 1.3
This commit is contained in:
commit
4c0a6d952f
3 changed files with 30 additions and 24 deletions
|
@ -167,16 +167,6 @@ class Dispatcher extends Object {
|
|||
if (!empty($this->params['bare'])) {
|
||||
$controller->autoLayout = false;
|
||||
}
|
||||
if (array_key_exists('layout', $this->params)) {
|
||||
if (empty($this->params['layout'])) {
|
||||
$controller->autoLayout = false;
|
||||
} else {
|
||||
$controller->layout = $this->params['layout'];
|
||||
}
|
||||
}
|
||||
if (isset($this->params['viewPath'])) {
|
||||
$controller->viewPath = $this->params['viewPath'];
|
||||
}
|
||||
return $this->_invoke($controller, $this->params);
|
||||
}
|
||||
|
||||
|
|
|
@ -1516,17 +1516,10 @@ class DispatcherTest extends CakeTestCase {
|
|||
|
||||
$controller = $Dispatcher->dispatch($url, array('return' => 1));
|
||||
|
||||
$expected = 'my_plugin';
|
||||
$this->assertIdentical($controller->plugin, $expected);
|
||||
|
||||
$expected = 'MyPlugin';
|
||||
$this->assertIdentical($controller->name, $expected);
|
||||
|
||||
$expected = 'add';
|
||||
$this->assertIdentical($controller->action, $expected);
|
||||
|
||||
$expected = array('param' => 'value', 'param2' => 'value2');
|
||||
$this->assertEqual($controller->params['named'], $expected);
|
||||
$this->assertIdentical($controller->plugin, 'my_plugin');
|
||||
$this->assertIdentical($controller->name, 'MyPlugin');
|
||||
$this->assertIdentical($controller->action, 'add');
|
||||
$this->assertEqual($controller->params['named'], array('param' => 'value', 'param2' => 'value2'));
|
||||
|
||||
|
||||
Router::reload();
|
||||
|
@ -1678,6 +1671,8 @@ class DispatcherTest extends CakeTestCase {
|
|||
App::build(array(
|
||||
'plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)
|
||||
), true);
|
||||
App::objects('plugin', null, false);
|
||||
|
||||
$Dispatcher =& new TestDispatcher();
|
||||
$Dispatcher->base = false;
|
||||
|
||||
|
@ -1687,6 +1682,21 @@ class DispatcherTest extends CakeTestCase {
|
|||
$this->assertEqual($controller->params['plugin'], 'test_plugin');
|
||||
$this->assertEqual($controller->params['action'], 'index');
|
||||
$this->assertFalse(isset($controller->params['pass'][0]));
|
||||
|
||||
$url = '/test_plugin/tests/index';
|
||||
$controller = $Dispatcher->dispatch($url, array('return' => 1));
|
||||
$this->assertEqual($controller->params['controller'], 'tests');
|
||||
$this->assertEqual($controller->params['plugin'], 'test_plugin');
|
||||
$this->assertEqual($controller->params['action'], 'index');
|
||||
$this->assertFalse(isset($controller->params['pass'][0]));
|
||||
|
||||
$url = '/test_plugin/tests/index/some_param';
|
||||
$controller = $Dispatcher->dispatch($url, array('return' => 1));
|
||||
$this->assertEqual($controller->params['controller'], 'tests');
|
||||
$this->assertEqual($controller->params['plugin'], 'test_plugin');
|
||||
$this->assertEqual($controller->params['action'], 'index');
|
||||
$this->assertEqual($controller->params['pass'][0], 'some_param');
|
||||
|
||||
App::build();
|
||||
}
|
||||
|
||||
|
@ -1985,7 +1995,7 @@ class DispatcherTest extends CakeTestCase {
|
|||
'views' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views' . DS),
|
||||
), true);
|
||||
|
||||
$dispatcher =& new Dispatcher();
|
||||
$dispatcher =& new TestDispatcher();
|
||||
$dispatcher->base = false;
|
||||
|
||||
$url = '/';
|
||||
|
@ -2119,7 +2129,7 @@ class DispatcherTest extends CakeTestCase {
|
|||
'views' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views'. DS)
|
||||
));
|
||||
|
||||
$dispatcher =& new Dispatcher();
|
||||
$dispatcher =& new TestDispatcher();
|
||||
$dispatcher->base = false;
|
||||
|
||||
$url = 'test_cached_pages/cache_form';
|
||||
|
@ -2139,6 +2149,7 @@ class DispatcherTest extends CakeTestCase {
|
|||
|
||||
$this->assertEqual($result, $expected);
|
||||
$filename = $this->__cachePath($dispatcher->here);
|
||||
@unlink($filename);
|
||||
ClassRegistry::flush();
|
||||
}
|
||||
|
||||
|
|
|
@ -662,7 +662,9 @@ class ObjectTest extends CakeTestCase {
|
|||
'models' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'models' . DS),
|
||||
'views' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views' . DS),
|
||||
'controllers' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'controllers' . DS)
|
||||
), true);
|
||||
));
|
||||
App::objects('plugin', null, false);
|
||||
Router::reload();
|
||||
|
||||
$result = $this->object->requestAction('/tests_apps/index', array('return'));
|
||||
$expected = 'This is the TestsAppsController index view';
|
||||
|
@ -716,6 +718,9 @@ class ObjectTest extends CakeTestCase {
|
|||
|
||||
$result = $this->object->requestAction(array('controller'=>'request_action', 'action'=>'paginate_request_action'), array('pass' => array(5), 'named' => array('param' => 'value')));
|
||||
$this->assertTrue($result);
|
||||
|
||||
App::build();
|
||||
App::objects('plugin', null, false);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Reference in a new issue