require_once dirname(__FILE__).'/../../include/CLegacyWebTest.php';
require_once dirname(__FILE__).'/../../../include/items.inc.php';
use Facebook\WebDriver\WebDriverBy;
class testInheritanceWeb extends CLegacyWebTest {
private $templateid = 15000;
private $template = 'Inheritance test template';
private $host = 'Template inheritance test host';
public static function update() {
return CDBHelper::getDataProvider(
'SELECT httptestid,hostid'.
public function testInheritanceWeb_SimpleUpdate($data) {
$sqlHttpTests = 'SELECT * FROM httptest ORDER BY httptestid';
$oldHashHttpTests = CDBHelper::getHash($sqlHttpTests);
$sqlHttpSteps = 'SELECT * FROM httpstep ORDER BY httpstepid';
$oldHashHttpSteps = CDBHelper::getHash($sqlHttpSteps);
$sqlHttpTestItems = 'SELECT * FROM httptestitem ORDER BY httptestitemid';
$oldHashHttpTestItems = CDBHelper::getHash($sqlHttpTestItems);
$sqlHttpStepItems = 'SELECT * FROM httpstepitem ORDER BY httpstepitemid';
$oldHashHttpStepItems = CDBHelper::getHash($sqlHttpStepItems);
$sqlItems = 'SELECT * FROM items ORDER BY itemid';
$oldHashItems = CDBHelper::getHash($sqlItems);
$this->zbxTestLogin('httpconf.php?form=update&context=host&hostid='.$data['hostid'].'&httptestid='.
$this->zbxTestClickWait('update');
$this->zbxTestCheckTitle('Configuration of web monitoring');
$this->zbxTestTextPresent('Web scenario updated');
$this->assertEquals($oldHashHttpTests, CDBHelper::getHash($sqlHttpTests));
$this->assertEquals($oldHashHttpSteps, CDBHelper::getHash($sqlHttpSteps));
$this->assertEquals($oldHashHttpTestItems, CDBHelper::getHash($sqlHttpTestItems));
$this->assertEquals($oldHashHttpStepItems, CDBHelper::getHash($sqlHttpStepItems));