mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 00:48:25 +00:00
updating dispatcher test for Jippi
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5755 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
c532212234
commit
4579ce68ea
1 changed files with 37 additions and 0 deletions
|
@ -117,6 +117,20 @@ class TestDispatchPagesController extends AppController {
|
|||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
class ArticlesTestAppController extends AppController {
|
||||
|
||||
}
|
||||
|
||||
class ArticlesTestController extends ArticlesTestAppController {
|
||||
|
||||
var $name = 'ArticlesTest';
|
||||
var $uses = array();
|
||||
|
||||
function admin_index() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Short description for class.
|
||||
*
|
||||
|
@ -566,6 +580,29 @@ class DispatcherTest extends UnitTestCase {
|
|||
|
||||
$expected = array('param'=>'value', 'param2'=>'value2');
|
||||
$this->assertEqual($controller->params['pass'], $expected);
|
||||
|
||||
Router::reload();
|
||||
$dispatcher =& new TestDispatcher();
|
||||
$dispatcher->base = false;
|
||||
$url = 'admin/articles_test';
|
||||
|
||||
restore_error_handler();
|
||||
@$controller = $dispatcher->dispatch($url, array('return' => 1));
|
||||
set_error_handler('simpleTestErrorHandler');
|
||||
|
||||
$expected = 'articles_test';
|
||||
$this->assertIdentical($controller->plugin, $expected);
|
||||
|
||||
$expected = 'ArticlesTest';
|
||||
$this->assertIdentical($controller->name, $expected);
|
||||
|
||||
$expected = 'admin_index';
|
||||
$this->assertIdentical($controller->action, $expected);
|
||||
$expected = array('pass'=> array(), 'controller' => 'articles_test', 'plugin' => 'articles_test', 'action' => 'admin_index',
|
||||
'prefix' => 'admin', 'admin' => true, 'form' => array(), 'url' => array('url' => 'admin/articles_test'),
|
||||
'bare' => 0, 'webservices' => null, 'return' => 1
|
||||
);
|
||||
$this->assertIdentical($controller->params, $expected);
|
||||
}
|
||||
|
||||
function testAutomaticPluginControllerMissingActionDispatch() {
|
||||
|
|
Loading…
Add table
Reference in a new issue