Permalink
Browse files

Make generated id use `-` like other ids CakePHP generates.

  • Loading branch information...
1 parent dfc7487 commit 0953c3d1bee4d8bb3a65939c0ea1743b869cb735 @markstory markstory committed Mar 7, 2014
Showing with 4 additions and 4 deletions.
  1. +1 −1 src/View/Helper/SessionHelper.php
  2. +3 −3 tests/TestCase/View/Helper/SessionHelperTest.php
@@ -36,7 +36,7 @@ class SessionHelper extends Helper {
* @var array
*/
protected $_defaultTemplates = [
- 'flash' => '<div id="{{key}}Message" class="{{class}}">{{message}}</div>'
+ 'flash' => '<div id="{{key}}-message" class="{{class}}">{{message}}</div>'
];
/**
@@ -121,11 +121,11 @@ public function testCheck() {
*/
public function testFlash() {
$result = $this->Session->flash('flash');
- $expected = '<div id="flashMessage" class="message">This is a calling</div>';
+ $expected = '<div id="flash-message" class="message">This is a calling</div>';
$this->assertEquals($expected, $result);
$this->assertFalse($this->Session->check('Message.flash'));
- $expected = '<div id="classyMessage" class="positive">Recorded</div>';
+ $expected = '<div id="classy-message" class="positive">Recorded</div>';
$result = $this->Session->flash('classy');
$this->assertEquals($expected, $result);
@@ -148,7 +148,7 @@ public function testFlash() {
*/
public function testFlashAttributes() {
$result = $this->Session->flash('flash', array('params' => array('class' => 'test-message')));
- $expected = '<div id="flashMessage" class="test-message">This is a calling</div>';
+ $expected = '<div id="flash-message" class="test-message">This is a calling</div>';
$this->assertEquals($expected, $result);
$this->assertFalse($this->Session->check('Message.flash'));
}

0 comments on commit 0953c3d

Please sign in to comment.