Skip to content
Snippets Groups Projects
Unverified Commit 3a49a5ba authored by Eileen McNaughton's avatar Eileen McNaughton Committed by GitHub
Browse files

Merge pull request #17914 from demeritcowboy/invisible-messages

drupal#127 - CRM_Core_Session::setStatus() gets ignored sometimes
parents c52e24a5 32710836
Branches
Tags
No related merge requests found
......@@ -8,7 +8,7 @@
+--------------------------------------------------------------------+
*}
{* Handles display of passed $infoMessage. *}
{if $infoMessage}
{if $infoMessage or $infoTitle}
<div class="messages status {$infoType}"{if $infoOptions} data-options='{$infoOptions}'{/if}>
<div class="icon inform-icon"></div>
<span class="msg-title">{$infoTitle}</span>
......
<?php
/**
* Class CRM_Core_SessionTest
* @group headless
*/
class CRM_Core_SessionTest extends CiviUnitTestCase {
public function setUp() {
CRM_Core_Smarty::singleton()->clearTemplateVars();
}
/**
* Test that the template setStatus uses gives reasonable output.
* Test with text only.
*/
public function testSetStatusWithTextOnly() {
$smarty = CRM_Core_Smarty::singleton();
$smarty->assign('infoMessage', 'Your refridgerator door is open.');
$output = $smarty->fetch('CRM/common/info.tpl');
$this->assertStringContainsString('Your refridgerator door is open.', $output);
}
/**
* Test that the template setStatus uses gives reasonable output.
* Test with title only.
*/
public function testSetStatusWithTitleOnly() {
$smarty = CRM_Core_Smarty::singleton();
$smarty->assign('infoTitle', 'Error Error Error.');
$output = $smarty->fetch('CRM/common/info.tpl');
$this->assertStringContainsString('Error Error Error.', $output);
}
/**
* Test that the template setStatus uses gives reasonable output.
* Test with both text and title.
*/
public function testSetStatusWithBoth() {
$smarty = CRM_Core_Smarty::singleton();
$smarty->assign('infoTitle', 'Spoiler alert!');
$smarty->assign('infoMessage', 'Your refridgerator door is open.');
$output = $smarty->fetch('CRM/common/info.tpl');
$this->assertStringContainsString('Spoiler alert!', $output);
$this->assertStringContainsString('Your refridgerator door is open.', $output);
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment