2 // This file is part of Moodle - http://moodle.org/
4 // Moodle is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU General Public License as published by
6 // the Free Software Foundation, either version 3 of the License, or
7 // (at your option) any later version.
9 // Moodle is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
14 // You should have received a copy of the GNU General Public License
15 // along with Moodle. If not, see <http://www.gnu.org/licenses/>.
20 * @package core_calendar
21 * @copyright 2017 Cameron Ball <cameron@cameron1729.xyz>
22 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
25 defined('MOODLE_INTERNAL') ||
die();
27 use core_calendar\local\event\value_objects\action
;
32 * @copyright 2017 Cameron Ball <cameron@cameron1729.xyz>
33 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
35 class core_calendar_action_testcase
extends advanced_testcase
{
37 * Test action class getters.
39 * @dataProvider getters_testcases()
40 * @param array $constructorparams Associative array of constructor parameters.
42 public function test_getters($constructorparams) {
44 $constructorparams['name'],
45 $constructorparams['url'],
46 $constructorparams['item_count'],
47 $constructorparams['actionable']
50 foreach ($constructorparams as $name => $value) {
51 if ($name == 'actionable') {
52 $this->assertEquals($action->is_actionable(), $value);
54 $this->assertEquals($action->{'get_' . $name}(), $value);
60 * Test cases for getters test.
62 public function getters_testcases() {
65 'constructorparams' => [
67 'url' => new moodle_url('http://example.com'),
73 'constructorparams' => [
75 'url' => new moodle_url('http://example.com'),