Source
xxxxxxxxxx
$this->assertEquals(0, CDBHelper::getCount("SELECT screenid FROM screens WHERE name='$this->testscreen_history'"));
<?php
/*
** Zabbix
** Copyright (C) 2001-2022 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/CLegacyWebTest.php';
use Facebook\WebDriver\WebDriverBy;
/**
* @backup screens
*/
class testFormScreen extends CLegacyWebTest {
public $testscreen = 'Test screen (clock)';
public $new_screen_name = 'Changed screen name';
public $testscreen_graph = 'Test screen (graph)';
public $cloned_screen = 'Cloned screen';
public $testscreen_history = 'Test screen (history of actions)';
public $testscreen_ = 'Test screen (simple graph)';
public static function create() {
return [
[
[
'expected' => TEST_GOOD,
'name' => 'Test Screen',
'dbCheck' => true,
'formCheck' => true
]
],
[
[
'expected' => TEST_GOOD,
'name' => 'Test Screen owner guest, max column and row',
'owner' => 'guest',
'columns' => 100,
'rows' => 100,
'dbCheck' => true,
'formCheck' => true
]
],
[
[
'expected' => TEST_BAD,
'name' => 'Test Screen',
'error_msg' => 'Cannot add screen',
'errors' => [
'Screen "Test Screen" already exists.'
]
]
],
[
[
'expected' => TEST_BAD,
'name' => '',
'columns' => 1,
'rows' => 1,
'error_msg' => 'Page received incorrect data',
'errors' => [
'Incorrect value for field "Name": cannot be empty.'
]
]
],
[
[
'expected' => TEST_BAD,
'name' => 'without owner',
'columns' => 1,
'rows' => 1,
'remove_owner' => true,
'error_msg' => 'Cannot add screen',
'errors' => [
'Screen owner cannot be empty.'
]