cakephp2-php8/tests/libs/controller.php
brego dd5f22418e Tests run properly now - need to add more of them into /libs/helpers/html.php!
Data validation should work - not tested (will do it tomorrow).



git-svn-id: https://svn.cakephp.org/repo/trunk/cake@265 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-06-22 01:20:19 +00:00

43 lines
No EOL
1,014 B
PHP

<?PHP
uses('controller');
class ControllerTest extends UnitTestCase
{
var $controller;
// constructor of the test suite
function ControllerTest()
{
$this->UnitTestCase('Controller test');
}
// called before the test functions will be executed
// this function is defined in PHPUnit_TestCase and overwritten
// here
function setUp()
{
$this->controller = new Controller();
$this->controller->base = '/ease';
$data = array('foo'=>'foo_value', 'foobar'=>'foobar_value', 'tofu'=>'1');
$params = array('controller'=>'Test', 'action'=>'test_action', 'data'=>$data);
$here = '/cake/test';
$this->controller->params = $params;
$this->controller->data = $data;
$this->controller->here = $here;
$this->controller->action = $this->controller->params['action'];
$this->controller->passed_args = null;
}
// called after the test functions are executed
// this function is defined in PHPUnit_TestCase and overwritten
// here
function tearDown()
{
unset($this->controller);
}
}
?>