Skip to content

Commit

Permalink
Fixing inherited public properties not being set in SessionHelper.
Browse files Browse the repository at this point in the history
Adding tests for SessionHelper construction and the setting of inherited properties.  Fixes #94
  • Loading branch information
markstory committed Sep 17, 2009
1 parent 0065005 commit e0b6b25
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
2 changes: 2 additions & 0 deletions cake/libs/session.php
Expand Up @@ -151,6 +151,8 @@ function __construct($base = null, $start = true) {
if (strpos($this->host, ':') !== false) {
$this->host = substr($this->host, 0, strpos($this->host, ':'));
}
}
if (isset($_SESSION)) {
if (!class_exists('Security')) {
App::import('Core', 'Security');
}
Expand Down
12 changes: 10 additions & 2 deletions cake/tests/cases/libs/view/helpers/session.test.php
Expand Up @@ -62,9 +62,8 @@ class SessionHelperTest extends CakeTestCase {
* @access public
* @return void
*/
function setUp() {
function startTest() {
$this->Session = new SessionHelper();
$this->Session->__start();

$_SESSION = array(
'test' => 'info',
Expand Down Expand Up @@ -103,6 +102,15 @@ function tearDown() {
$_SESSION = array();
unset($this->Session);
}
/**
* test construction and initial property settings
*
* @return void
**/
function testConstruct() {
$this->assertFalse(empty($this->Session->sessionTime));
$this->assertFalse(empty($this->Session->security));
}
/**
* testRead method
*
Expand Down

0 comments on commit e0b6b25

Please sign in to comment.