class Foo_ControllerTest extends UnitTestCase
{
function test1()
{
$usersController = &new UsersController();
$usersController->_initComponents();
$usersController->constructClasses();
$this->assertNotNull($usersController->Session);
$usersController->Session->_checkValid();
}
}
This creates the model + components in your controller. The sessions should be working normally now.
Take at look at this to see how they did unit testing on the Session component itself for more ideas (https://trac.cakephp.org/browser/branches/1.2.x.x/cake/tests/cases/libs/session.test.php?rev=7246).
No comments:
Post a Comment