Making SessionHelper not use ClassRegistry to access View. SessionHelper still needs to not inherit from CakeSession.

This commit is contained in:
mark_story 2010-07-14 23:11:13 -04:00
parent 576eba3ef9
commit dfa5273b22
2 changed files with 3 additions and 7 deletions

View file

@ -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 = '<div id="' . $key . 'Message" class="' . $class . '">' . $flash['message'] . '</div>';
} elseif ($flash['element'] == '' || $flash['element'] == null) {

View file

@ -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 = "<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>";