Skip to content

Commit

Permalink
Making SessionHelper not use ClassRegistry to access View. SessionHel…
Browse files Browse the repository at this point in the history
…per still needs to not inherit from CakeSession.
  • Loading branch information
markstory committed Aug 11, 2010
1 parent 576eba3 commit dfa5273
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
4 changes: 3 additions & 1 deletion cake/libs/view/helpers/session.php
Expand Up @@ -92,7 +92,9 @@ public function flash($key = 'flash') {
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 = '<div id="' . $key . 'Message" class="' . $class . '">' . $flash['message'] . '</div>';
} elseif ($flash['element'] == '' || $flash['element'] == null) {
Expand Down
6 changes: 0 additions & 6 deletions cake/tests/cases/libs/view/helpers/session.test.php
Expand Up @@ -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'));

Expand Down Expand Up @@ -142,9 +139,6 @@ function testFlash() {
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 = "<div id=\"notificationLayout\">\n\t<h1>Alert!</h1>\n\t<h3>Notice!</h3>\n\t<p>This is a test of the emergency broadcasting system</p>\n</div>";
Expand Down

0 comments on commit dfa5273

Please sign in to comment.