From 230066a14b83a03d4ad13661bea6e24c38a91ed0 Mon Sep 17 00:00:00 2001 From: David Yell Date: Wed, 24 Jan 2018 10:13:56 +0000 Subject: [PATCH 1/3] Added a test case for the helper with no params. Relates to #11658 --- lib/Cake/Test/Case/View/Helper/SessionHelperTest.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lib/Cake/Test/Case/View/Helper/SessionHelperTest.php b/lib/Cake/Test/Case/View/Helper/SessionHelperTest.php index 5ff9737c6..adf2a0bb2 100644 --- a/lib/Cake/Test/Case/View/Helper/SessionHelperTest.php +++ b/lib/Cake/Test/Case/View/Helper/SessionHelperTest.php @@ -150,6 +150,18 @@ class SessionHelperTest extends CakeTestCase { $this->assertFalse($this->Session->check('Message.bare')); } +/** + * Test the flash method works without any params being passed + * + * @return void + */ + public function testFlashWithNoParams() { + $result = $this->Session->flash(); + $expected = '
This is a calling
'; + $this->assertEquals($expected, $result); + $this->assertFalse($this->Session->check('Message.flash')); + } + /** * test flash() with the attributes. * From bcae20029c48149287c2feb4eba96061fbf3ac1b Mon Sep 17 00:00:00 2001 From: David Yell Date: Wed, 24 Jan 2018 10:33:45 +0000 Subject: [PATCH 2/3] Fixed the PHPCS warnings --- lib/Cake/Test/Case/View/Helper/SessionHelperTest.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/Cake/Test/Case/View/Helper/SessionHelperTest.php b/lib/Cake/Test/Case/View/Helper/SessionHelperTest.php index adf2a0bb2..e0ad111d3 100644 --- a/lib/Cake/Test/Case/View/Helper/SessionHelperTest.php +++ b/lib/Cake/Test/Case/View/Helper/SessionHelperTest.php @@ -156,10 +156,10 @@ class SessionHelperTest extends CakeTestCase { * @return void */ public function testFlashWithNoParams() { - $result = $this->Session->flash(); - $expected = '
This is a calling
'; - $this->assertEquals($expected, $result); - $this->assertFalse($this->Session->check('Message.flash')); + $result = $this->Session->flash(); + $expected = '
This is a calling
'; + $this->assertEquals($expected, $result); + $this->assertFalse($this->Session->check('Message.flash')); } /** From 5d9a3cb2bafafacb2c68c279dba401f8f67f5ff4 Mon Sep 17 00:00:00 2001 From: mark_story Date: Wed, 24 Jan 2018 21:17:52 -0500 Subject: [PATCH 3/3] Fix phpcs error. --- lib/Cake/Test/Case/View/Helper/SessionHelperTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Cake/Test/Case/View/Helper/SessionHelperTest.php b/lib/Cake/Test/Case/View/Helper/SessionHelperTest.php index e0ad111d3..99b807d01 100644 --- a/lib/Cake/Test/Case/View/Helper/SessionHelperTest.php +++ b/lib/Cake/Test/Case/View/Helper/SessionHelperTest.php @@ -155,7 +155,7 @@ class SessionHelperTest extends CakeTestCase { * * @return void */ - public function testFlashWithNoParams() { + public function testFlashWithNoParams() { $result = $this->Session->flash(); $expected = '
This is a calling
'; $this->assertEquals($expected, $result);