ILIAS  release_7 Revision v7.30-3-g800a261c036
All Data Structures Namespaces Files Functions Variables Modules Pages
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 
25 
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 
88  $params = ilParameterAppender::_getParams(888);
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 }
$data
Definition: storeScorm.php:23
testWebResourceParameters()
IL_Init
testLinkCheck()
Link check test IL_Init.
static _deleteObject($a_obj_id)
class for checking external links in page objects.
static _getNotifiers($a_obj_id)
Unit tests for tree table needsInstalledILIAS.
global $DIC
Definition: goto.php:24
static _getNotifyStatus($a_usr_id, $a_obj_id)
global $ilDB
$ret
Definition: parser.php:6
Class ilParameterAppender.
static _getParams($a_link_id)
Get dynamic parameter definitions.