public function testFormAdministrationGeneralWorkperiod_SavingWorkperiod($work_period, $expected, $msg) {
require_once dirname(__FILE__).'/../include/CLegacyWebTest.php';
class testFormAdministrationGeneralWorkperiod extends CLegacyWebTest {
public static function WorkingTime() {
return CDBHelper::getDataProvider('SELECT work_period FROM config ORDER BY configid');
public function testFormAdministrationGeneralWorkperiod_CheckLayout($WorkingTime) {
$this->zbxTestLogin('zabbix.php?action=gui.edit');
$this->zbxTestCheckHeader('GUI');
$this->query('id:page-title-general')->asPopupButton()->one()->select('Working time');
$this->zbxTestCheckTitle('Configuration of working time');
$this->zbxTestCheckHeader('Working time');
$this->zbxTestAssertAttribute("//input[@id='work_period']", "maxlength", 255);
$this->zbxTestAssertAttribute("//input[@id='work_period']", "value", $WorkingTime['work_period']);
public function testFormAdministrationGeneralWorkperiod_SimpleUpdate() {
$sqlHash = 'SELECT * FROM config ORDER BY configid';
$oldHash = CDBHelper::getHash($sqlHash);
$this->zbxTestLogin('zabbix.php?action=workingtime.edit');
$this->zbxTestCheckTitle('Configuration of working time');
$this->zbxTestCheckHeader('Working time');
$this->zbxTestClickWait('update');
$this->zbxTestWaitUntilMessageTextPresent('msg-good', 'Configuration updated');
$this->assertEquals($oldHash, CDBHelper::getHash($sqlHash));
public static function data() {
'success_expected' => TEST_BAD,
'error-msg' => 'Incorrect value for field "work_period": a time period is expected.'