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:
gwoo 2007-10-14 16:53:36 +00:00
parent c532212234
commit 4579ce68ea

View file

@ -117,6 +117,20 @@ class TestDispatchPagesController extends AppController {
return true; 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. * Short description for class.
* *
@ -566,6 +580,29 @@ class DispatcherTest extends UnitTestCase {
$expected = array('param'=>'value', 'param2'=>'value2'); $expected = array('param'=>'value', 'param2'=>'value2');
$this->assertEqual($controller->params['pass'], $expected); $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() { function testAutomaticPluginControllerMissingActionDispatch() {