mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Fixed access to protected property in CakeSession tests.
This commit is contained in:
parent
e1e96e213a
commit
97388d2e61
1 changed files with 9 additions and 3 deletions
|
@ -21,6 +21,12 @@ if (!class_exists('CakeSession')) {
|
|||
App::import('Core', 'CakeSession');
|
||||
}
|
||||
|
||||
class TestCakeSession extends CakeSession {
|
||||
public function setUserAgent($value) {
|
||||
$this->_userAgent = $value;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* CakeSessionTest class
|
||||
*
|
||||
|
@ -67,7 +73,7 @@ class CakeSessionTest extends CakeTestCase {
|
|||
* @return void
|
||||
*/
|
||||
function setUp() {
|
||||
$this->Session =& new CakeSession();
|
||||
$this->Session =& new TestCakeSession();
|
||||
$this->Session->start();
|
||||
$this->Session->_checkValid();
|
||||
}
|
||||
|
@ -331,7 +337,7 @@ class CakeSessionTest extends CakeTestCase {
|
|||
*/
|
||||
function testCheckUserAgentFalse() {
|
||||
Configure::write('Session.checkAgent', false);
|
||||
$this->Session->_userAgent = md5('http://randomdomainname.com' . Configure::read('Security.salt'));
|
||||
$this->Session->setUserAgent(md5('http://randomdomainname.com' . Configure::read('Security.salt')));
|
||||
$this->assertTrue($this->Session->valid());
|
||||
}
|
||||
|
||||
|
@ -343,7 +349,7 @@ class CakeSessionTest extends CakeTestCase {
|
|||
*/
|
||||
function testCheckUserAgentTrue() {
|
||||
Configure::write('Session.checkAgent', true);
|
||||
$this->Session->_userAgent = md5('http://randomdomainname.com' . Configure::read('Security.salt'));
|
||||
$this->Session->setUserAgent(md5('http://randomdomainname.com' . Configure::read('Security.salt')));
|
||||
$this->assertFalse($this->Session->valid());
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue