mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-19 11:06:15 +00:00
Making SessionHelper not use ClassRegistry to access View. SessionHelper still needs to not inherit from CakeSession.
This commit is contained in:
parent
576eba3ef9
commit
dfa5273b22
2 changed files with 3 additions and 7 deletions
|
@ -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) {
|
||||
|
|
|
@ -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>";
|
||||
|
|
Loading…
Add table
Reference in a new issue