diff --git a/cake/libs/view/helpers/session.php b/cake/libs/view/helpers/session.php index 776334455..7fac48602 100644 --- a/cake/libs/view/helpers/session.php +++ b/cake/libs/view/helpers/session.php @@ -92,7 +92,9 @@ class SessionHelper extends AppHelper { if (!empty($flash['params']['class'])) { $class = $flash['params']['class']; } else { - $class = 'message'; + $tmpVars = $flash['params']; + $tmpVars['message'] = $flash['message']; + $out = $this->_View->element($flash['element'], $tmpVars); } $out = '
' . $flash['message'] . '
'; } elseif ($flash['element'] == '' || $flash['element'] == null) { diff --git a/cake/tests/cases/libs/view/helpers/session.test.php b/cake/tests/cases/libs/view/helpers/session.test.php index b84919df0..708c55545 100644 --- a/cake/tests/cases/libs/view/helpers/session.test.php +++ b/cake/tests/cases/libs/view/helpers/session.test.php @@ -17,9 +17,6 @@ * @since CakePHP(tm) v 1.2.0.4206 * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License */ -if (!defined('CAKEPHP_UNIT_TEST_EXECUTION')) { - define('CAKEPHP_UNIT_TEST_EXECUTION', 1); -} App::import('Core', array('Helper', 'AppHelper', 'Controller', 'View')); App::import('Helper', array('Session')); @@ -142,9 +139,6 @@ class SessionHelperTest extends CakeTestCase { App::build(array( 'views' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views'. DS) )); - $controller = new Controller(); - $this->Session->view = new View($controller); - $result = $this->Session->flash('notification', true); $result = str_replace("\r\n", "\n", $result); $expected = "
\n\t

Alert!

\n\t

Notice!

\n\t

This is a test of the emergency broadcasting system

\n
";