Source
$this->assertTrue($form->getField('Name')->isAttributePresent(['maxlength' => '255', 'placeholder' => 'default']));
<?php
/*
** Copyright (C) 2001-2025 Zabbix SIA
**
** This program is free software: you can redistribute it and/or modify it under the terms of
** the GNU Affero General Public License as published by the Free Software Foundation, version 3.
**
** This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
** without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
** See the GNU Affero General Public License for more details.
**
** You should have received a copy of the GNU Affero General Public License along with this program.
** If not, see <https://www.gnu.org/licenses/>.
**/
require_once dirname(__FILE__).'/../common/testWidgets.php';
/**
* @backup widget, profiles
*
* @onBefore prepareData
*/
class testDashboardWebMonitoringWidget extends testWidgets {
protected static $dashboardid;
protected static $groupids;
protected static $update_widget = 'Update Web monitoring widget';
const DEFAULT_DASHBOARD = 'Dashboard for Web monitoring widget test';
const DASHBOARD_FOR_WIDGET_ACTIONS = 'Dashboard for Web monitoring widget create/update test';
/**
* Attach MessageBehavior and TagBehavior to the test.
*
* @return array
*/
public function getBehaviors() {
return [
CMessageBehavior::class,
CTableBehavior::class,
[
'class' => CTagBehavior::class,
'tag_selector' => 'id:tags_table_tags'
]
];
}
// Create data for autotests that use Web monitoring widget.
public function prepareData() {
// Create a Dashboard and pages for widgets.
CDataHelper::call('dashboard.create', [
[
'name' => self::DEFAULT_DASHBOARD,
'pages' => [
[
'name' => 'Layout'
]
]
],
[
'name' => self::DASHBOARD_FOR_WIDGET_ACTIONS,
'pages' => [
[