Source
'match' => 'md01-31wd/6,1-5/4,2-7/5h1-5,7-10/03m1-1,58-59/1,/1,/59s/30,1-4,05-09,58-59/1,/1,/59'
<?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/>.
**/
use PHPUnit\Framework\TestCase;
class CSchedulingIntervalParserTest extends TestCase {
/**
* An array of time periods and parsed results.
*/
public static function dataProvider() {
return [
// success
[
'md/30', 0, [],
[
'rc' => CParser::PARSE_SUCCESS,
'match' => 'md/30'
]
],
[
'md1-31/30', 0, [],
[
'rc' => CParser::PARSE_SUCCESS,
'match' => 'md1-31/30'
]
],
[
'md1-1', 0, [],
[
'rc' => CParser::PARSE_SUCCESS,
'match' => 'md1-1'
]
],
[
'md28-30', 0, [],
[
'rc' => CParser::PARSE_SUCCESS,
'match' => 'md28-30'
]
],
[
'md15-30/4', 0, [],
[
'rc' => CParser::PARSE_SUCCESS,
'match' => 'md15-30/4'
]
],
[
'md01-31', 0, [],