Add test for empty read() calls on CakeSession

This commit is contained in:
predominant 2010-07-22 19:19:53 +10:00 committed by mark_story
parent 623998f550
commit 7501fcf46d
2 changed files with 11 additions and 1 deletions

View file

@ -254,7 +254,7 @@ class CakeSession {
* @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;
}

View file

@ -194,6 +194,16 @@ class CakeSessionTest extends CakeTestCase {
$this->assertEqual('value', $result);
}
/**
* testReadyEmpty
*
* @author Predominant
* @access public
*/
function testReadyEmpty() {
$this->assertFalse(TestCakeSession::read(''));
}
/**
* test writing a hash of values/
*