$sql_hash = 'SELECT '.CDBHelper::getTableFields('config', ['custom_color', 'problem_unack_color', 'problem_ack_color', 'ok_unack_color', 'ok_ack_color', 'problem_unack_style', 'problem_ack_style', 'ok_unack_style', 'ok_ack_style', 'ok_period', 'blink_period']).' FROM config ORDER BY configid';
require_once dirname(__FILE__).'/../include/CLegacyWebTest.php';
class testFormAdministrationGeneralTrigDisplOptions extends CLegacyWebTest {
public static function allValues() {
return CDBHelper::getDataProvider(
'SELECT custom_color,problem_unack_color,problem_unack_style,problem_ack_color,problem_ack_style,'.
'ok_unack_color,ok_unack_style,ok_ack_color,ok_ack_style,ok_period,blink_period'.
public function testFormAdministrationGeneralTrigDisplOptions_Layout($allValues) {
$this->zbxTestLogin('zabbix.php?action=trigdisplay.edit');
$this->zbxTestCheckHeader('Trigger displaying options');
$this->zbxTestTextPresent(
'Trigger displaying options',
'Use custom event status colours',
'Unacknowledged PROBLEM events',
'Acknowledged PROBLEM events',
'Unacknowledged RESOLVED events',
'Acknowledged RESOLVED events',
'Display OK triggers for',
'On status change triggers blink for'
$this->assertEquals($this->zbxTestCheckboxSelected('custom_color'), (bool) $allValues['custom_color']);
$this->zbxTestAssertElementValue('problem_unack_color', $allValues['problem_unack_color']);
$this->zbxTestAssertElementValue('problem_ack_color', $allValues['problem_ack_color']);
$this->zbxTestAssertElementValue('ok_unack_color', $allValues['ok_unack_color']);
$this->zbxTestAssertElementValue('ok_ack_color', $allValues['ok_ack_color']);
$this->assertEquals($this->zbxTestCheckboxSelected('problem_unack_style'), (bool) $allValues['problem_unack_style']);
$this->assertEquals($this->zbxTestCheckboxSelected('problem_ack_style'), (bool) $allValues['problem_ack_style']);
$this->assertEquals($this->zbxTestCheckboxSelected('ok_unack_style'), (bool) $allValues['ok_unack_style']);
$this->assertEquals($this->zbxTestCheckboxSelected('ok_ack_style'), (bool) $allValues['ok_ack_style']);