Skip to content

Commit

Permalink
Fixed access to protected property in CakeSession tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
predominant committed Apr 4, 2010
1 parent e1e96e2 commit 97388d2
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions cake/tests/cases/libs/cake_session.test.php
Expand Up @@ -21,6 +21,12 @@
App::import('Core', 'CakeSession');
}

class TestCakeSession extends CakeSession {
public function setUserAgent($value) {
$this->_userAgent = $value;
}
}

/**
* CakeSessionTest class
*
Expand Down Expand Up @@ -67,7 +73,7 @@ function endCase() {
* @return void
*/
function setUp() {
$this->Session =& new CakeSession();
$this->Session =& new TestCakeSession();
$this->Session->start();
$this->Session->_checkValid();
}
Expand Down Expand Up @@ -331,7 +337,7 @@ function testReadingSavedEmpty() {
*/
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());
}

Expand All @@ -343,7 +349,7 @@ function testCheckUserAgentFalse() {
*/
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());
}

Expand Down

0 comments on commit 97388d2

Please sign in to comment.