ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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
25{
26 protected $backupGlobals = FALSE;
27 protected $preserveGlobalState = FALSE;
28
29 protected function setUp()
30 {
31 include_once("./Services/PHPUnit/classes/class.ilUnitUtil.php");
32 ilUnitUtil::performInitialisation();
33 }
34
39 public function testMemberAgreement()
40 {
41 include_once 'Services/Membership/classes/class.ilMemberAgreement.php';
42
43 global $ilDB;
44
45
46 $agree = new ilMemberAgreement(9999,8888);
47 $agree->read();
48 $agree->setAccepted(true);
49 $agree->save();
50
51 $agree = new ilMemberAgreement(9999,8888);
52 $agree->read();
53 $sta = $agree->isAccepted();
54 $this->assertEquals($sta,true);
55 $agree->delete();
56
57 $agree = new ilMemberAgreement(9999,8888);
58 $agree->read();
59 $sta = $agree->isAccepted();
60 $this->assertEquals($sta,false);
61
62 $sta = ilMemberAgreement::_hasAccepted(9999,8888);
63 $this->assertEquals($sta,false);
64
65 $agree = new ilMemberAgreement(9999,8888);
66 $agree->read();
67 $agree->setAccepted(true);
68 $agree->save();
69
71 $this->assertEquals($sta,true);
72
74 $this->assertEquals($sta,true);
75
77 }
78
79}
80?>
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