Skip to content

Commit

Permalink
Add test for empty read() calls on CakeSession
Browse files Browse the repository at this point in the history
  • Loading branch information
predominant authored and markstory committed Jul 28, 2010
1 parent 623998f commit 7501fcf
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion cake/libs/cake_session.php
Expand Up @@ -254,7 +254,7 @@ public static function started() {
* @param string $name Variable name to check for
* @return boolean True if variable is there
*/
public static function check($name) {
public static function check($name = null) {
if (empty($name)) {
return false;
}
Expand Down
10 changes: 10 additions & 0 deletions cake/tests/cases/libs/cake_session.test.php
Expand Up @@ -194,6 +194,16 @@ function testSimpleRead() {
$this->assertEqual('value', $result);
}

/**
* testReadyEmpty
*
* @author Predominant
* @access public
*/
function testReadyEmpty() {
$this->assertFalse(TestCakeSession::read(''));
}

/**
* test writing a hash of values/
*
Expand Down

0 comments on commit 7501fcf

Please sign in to comment.