Fixing component and controller test cases to work with less magical session component.

This commit is contained in:
Mark Story 2010-01-13 23:33:56 -05:00
parent ebf99de965
commit 540e81b1b0
5 changed files with 9 additions and 7 deletions

View file

@ -452,7 +452,7 @@ class ComponentTest extends CakeTestCase {
$this->assertTrue(is_a($Controller->ParamTest, 'ParamTestComponent'));
$this->assertTrue(is_a($Controller->ParamTest->Banana, 'BananaComponent'));
$this->assertTrue(is_a($Controller->Orange, 'OrangeComponent'));
$this->assertTrue(is_a($Controller->Session, 'SessionComponent'));
$this->assertFalse(isset($Controller->Session));
$this->assertEqual($Controller->Orange->settings, array('colour' => 'blood orange'));
$this->assertEqual($Controller->ParamTest->test, 'value');
$this->assertEqual($Controller->ParamTest->flag, true);

View file

@ -237,7 +237,7 @@ class AuthTestController extends Controller {
* @var array
* @access public
*/
var $components = array('Auth', 'Acl');
var $components = array('Session', 'Auth', 'Acl');
/**
* testUrl property
@ -382,7 +382,7 @@ class AjaxAuthController extends Controller {
* @var array
* @access public
*/
var $components = array('TestAuth');
var $components = array('Session', 'TestAuth');
/**
* uses property
@ -514,6 +514,7 @@ class AuthTest extends CakeTestCase {
$_ENV = $this->_env;
Configure::write('Acl', $this->_acl);
Configure::write('Security.salt', $this->_securitySalt);
$this->Controller->Session->delete('Auth');
$this->Controller->Session->delete('Message.auth');
ClassRegistry::flush();
@ -1539,7 +1540,8 @@ class AuthTest extends CakeTestCase {
'loginAction' => array('controller' => 'people', 'action' => 'login'),
'userModel' => 'AuthUserCustomField',
'sessionKey' => 'AltAuth.AuthUserCustomField'
)
),
'Session'
);
$this->Controller->Component->init($this->Controller);
$this->Controller->Component->initialize($this->Controller);

View file

@ -150,7 +150,7 @@ class EmailTestController extends Controller {
* @var array
* @access public
*/
var $components = array('EmailTest');
var $components = array('Session', 'EmailTest');
/**
* pageTitle property

View file

@ -60,7 +60,7 @@ class SecurityTestController extends Controller {
* @var array
* @access public
*/
var $components = array('TestSecurity');
var $components = array('Session', 'TestSecurity');
/**
* failed property

View file

@ -1077,7 +1077,7 @@ class ControllerTest extends CakeTestCase {
$Controller->uses = array();
$Controller->constructClasses();
$this->assertTrue(isset($Controller->Session));
$this->assertFalse(isset($Controller->Session));
}
/**