From 7501fcf46dc9106e47768c54dbf4e136585d61a2 Mon Sep 17 00:00:00 2001 From: predominant Date: Thu, 22 Jul 2010 19:19:53 +1000 Subject: [PATCH] Add test for empty read() calls on CakeSession --- cake/libs/cake_session.php | 2 +- cake/tests/cases/libs/cake_session.test.php | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/cake/libs/cake_session.php b/cake/libs/cake_session.php index a485e73c1..9be38d9cf 100644 --- a/cake/libs/cake_session.php +++ b/cake/libs/cake_session.php @@ -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; } diff --git a/cake/tests/cases/libs/cake_session.test.php b/cake/tests/cases/libs/cake_session.test.php index c071151eb..0ba7231da 100644 --- a/cake/tests/cases/libs/cake_session.test.php +++ b/cake/tests/cases/libs/cake_session.test.php @@ -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/ *