Source
* @param boolean $new_page true if the widget is copied to the new page, false if copied to the same page
<?php
/*
** Zabbix
** Copyright (C) 2001-2023 Zabbix SIA
**
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation; either version 2 of the License, or
** (at your option) any later version.
**
** 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 General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program; if not, write to the Free Software
** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
**/
require_once dirname(__FILE__) . '/../../include/CWebTest.php';
require_once dirname(__FILE__).'/../behaviors/CMessageBehavior.php';
require_once dirname(__FILE__).'/../../include/helpers/CDataHelper.php';
/**
* @onBefore getTemplatedIds
*
* @backup widget, profiles, module
*/
class testDashboardCopyWidgets extends CWebTest {
// Constants for regular dashboard cases.
const NEW_PAGE_NAME = 'Test_page';
const PASTE_DASHBOARD_NAME = 'Dashboard for Paste widgets';
// Constants for templated dashboard cases.
const TEMPLATED_DASHBOARD_NAME = 'Templated dashboard with all widgets';
const TEMPLATED_PAGE_NAME = 'Page for pasting widgets';
const EMPTY_DASHBOARD_NAME = 'Dashboard without widgets';
const MODULES_DASHBOARD_NAME = 'Dashboard for Copying widgets _1';
private static $templated_dashboardid;
private static $templated_empty_dashboardid;
private static $modules_dashboardid;
// Values for replacing widgets.
private static $replaced_widget_name = "Test widget for replace";
const REPLACED_WIDGET_SIZE = [ 'width' => '13', 'height' => '8'];
/**
* Attach MessageBehavior to the test.
*
* @return array
*/
public function getBehaviors() {
return ['class' => CMessageBehavior::class];
}
/**
* Get all widgets from dashboards with name starting with "Dashboard for Copying widgets".
*/
public static function getDashboardsData() {
static $data = null;