ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ilCourseTest.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
29{
30 protected $backupGlobals = FALSE;
31 protected $preserveGlobalState = FALSE;
32
33 protected function setUp()
34 {
35 include_once("./Services/PHPUnit/classes/class.ilUnitUtil.php");
36 ilUnitUtil::performInitialisation();
37 }
38
43 public function testMemberAgreement()
44 {
45 include_once 'Services/Membership/classes/class.ilMemberAgreement.php';
46
47 global $ilDB;
48
49
50 $agree = new ilMemberAgreement(9999,8888);
51 $agree->read();
52 $agree->setAccepted(true);
53 $agree->save();
54
55 $agree = new ilMemberAgreement(9999,8888);
56 $agree->read();
57 $sta = $agree->isAccepted();
58 $this->assertEquals($sta,true);
59 $agree->delete();
60
61 $agree = new ilMemberAgreement(9999,8888);
62 $agree->read();
63 $sta = $agree->isAccepted();
64 $this->assertEquals($sta,false);
65
66 $sta = ilMemberAgreement::_hasAccepted(9999,8888);
67 $this->assertEquals($sta,false);
68
69 $agree = new ilMemberAgreement(9999,8888);
70 $agree->read();
71 $agree->setAccepted(true);
72 $agree->save();
73
75 $this->assertEquals($sta,true);
76
78 $this->assertEquals($sta,true);
79
81 }
82
83}
84?>
An exception for terminatinating execution or to throw for unit testing.
Class ilCourseTest @group needsInstalledILIAS.
testMemberAgreement()
Test member agreement @group IL_Init.
static _hasAccepted($a_usr_id, $a_obj_id)
Check if user has accepted agreement.
static _hasAgreementsByObjId($a_obj_id)
Check if there is any user agreement.
static _hasAgreements()
Check if there is any user agreement.
static _deleteByUser($a_usr_id)
Delete all entries by user.
global $ilDB