ILIAS  release_7 Revision v7.30-3-g800a261c036
ilWebResourceTest.php
Go to the documentation of this file.
1<?php
2/*
3 +-----------------------------------------------------------------------------+
4 | ILIAS open source |
5 +-----------------------------------------------------------------------------+
6 | Copyright (c) 1998-2006 ILIAS open source, University of Cologne |
7 | |
8 | This program is free software; you can redistribute it and/or |
9 | modify it under the terms of the GNU General Public License |
10 | as published by the Free Software Foundation; either version 2 |
11 | of the License, or (at your option) any later version. |
12 | |
13 | This program is distributed in the hope that it will be useful, |
14 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16 | GNU General Public License for more details. |
17 | |
18 | You should have received a copy of the GNU General Public License |
19 | along with this program; if not, write to the Free Software |
20 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
21 +-----------------------------------------------------------------------------+
22*/
23
24use PHPUnit\Framework\TestCase;
25
36class ilwebresourceTest extends TestCase
37{
38 protected $backupGlobals = false;
39
40 protected function setUp() : void
41 {
42 include_once("./Services/PHPUnit/classes/class.ilUnitUtil.php");
43 ilUnitUtil::performInitialisation();
44 }
45
52 public function testLinkCheck()
53 {
54 global $DIC;
55
56 $ilDB = $DIC['ilDB'];
57
58 include_once './Services/LinkChecker/classes/class.ilLinkCheckNotify.php';
59
60 $not = new ilLinkCheckNotify($ilDB);
61 $not->setObjId(99999);
62 $not->setUserId(13);
63 $ret = $not->addNotifier();
64 $this->assertEquals($ret, true);
65
66 $status = ilLinkCheckNotify::_getNotifyStatus(13, 99999);
67 $this->assertEquals($status, true);
68
69 $notifiers = ilLinkCheckNotify::_getNotifiers(99999);
70 $this->assertEquals($notifiers, array(13));
71
73 $this->assertEquals($del, true);
74 }
75
79 public function testWebResourceParameters()
80 {
81 include_once './Modules/WebResource/classes/class.ilParameterAppender.php';
82
83 $appender = new ilParameterAppender(999);
84 $appender->setName('first');
85 $appender->setValue(1);
86 $appender->add(888);
87
89 foreach ($params as $key => $data) {
90 $appender->delete($key);
91 $this->assertEquals($data['name'], 'first');
92 $this->assertEquals($data['value'], 1);
93 }
94 }
95}
An exception for terminatinating execution or to throw for unit testing.
class for checking external links in page objects.
static _deleteObject($a_obj_id)
static _getNotifiers($a_obj_id)
static _getNotifyStatus($a_usr_id, $a_obj_id)
Class ilParameterAppender.
static _getParams($a_link_id)
Get dynamic parameter definitions.
Unit tests for tree table @group needsInstalledILIAS.
testLinkCheck()
Link check test @group IL_Init.
testWebResourceParameters()
@group IL_Init
global $DIC
Definition: goto.php:24
$ret
Definition: parser.php:6
global $ilDB
$data
Definition: storeScorm.php:23