mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-19 11:06:15 +00:00
Updated session lib test to use fixtures, fixes some of the errors in the test.
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@7095 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
f44c755475
commit
4b1335797c
1 changed files with 19 additions and 9 deletions
|
@ -242,29 +242,39 @@ class SessionTest extends CakeTestCase {
|
|||
$this->Session->write('SessionTestCase', null);
|
||||
$this->assertEqual($this->Session->read('SessionTestCase'), null);
|
||||
}
|
||||
|
||||
/**
|
||||
* testCheckUserAgentFalse method
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testCheckUserAgentFalse() {
|
||||
Configure::write('Session.checkAgent', false);
|
||||
$this->Session->_userAgent = md5('http://randomdomainname.com' . Configure::read('Security.salt'));
|
||||
$this->assertTrue($this->Session->valid());
|
||||
}
|
||||
|
||||
/**
|
||||
* testCheckUserAgentTrue method
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testCheckUserAgentTrue() {
|
||||
Configure::write('Session.checkAgent', true);
|
||||
$this->Session->_userAgent = md5('http://randomdomainname.com' . Configure::read('Security.salt'));
|
||||
$this->assertFalse($this->Session->valid());
|
||||
}
|
||||
|
||||
/**
|
||||
* testReadAndWriteWithDatabaseStorage method
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testReadAndWriteWithDatabaseStorage() {
|
||||
$this->tearDown();
|
||||
$this->loadFixtures('Session');
|
||||
unset($_SESSION);
|
||||
|
||||
Configure::write('Session.table', 'sessions');
|
||||
Configure::write('Session.database', 'default');
|
||||
Configure::write('Session.save', 'database');
|
||||
|
||||
$this->setUp();
|
||||
$this->Session->renew();
|
||||
|
||||
$this->Session->write('SessionTestCase', 0);
|
||||
$this->assertEqual($this->Session->read('SessionTestCase'), 0);
|
||||
|
|
Loading…
Add table
Reference in a new issue