ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
ilTermsOfServiceAcceptanceEntityTest.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2012 ILIAS open source, Extended GPL, see docs/LICENSE */
3
4require_once 'Services/TermsOfService/classes/class.ilTermsOfServiceAcceptanceEntity.php';
5
11{
15 protected $backupGlobals = false;
16
20 public function setUp()
21 {
22 }
23
27 public function testInstanceCanBeCreated()
28 {
30 $this->assertInstanceOf('ilTermsOfServiceAcceptanceEntity', $entity);
31 }
32
36 public function testIdIsInitiallyEmpty()
37 {
39 $this->assertEmpty($entity->getId());
40 }
41
46 {
48 $this->assertEmpty($entity->getUserId());
49 }
50
54 public function testTextIsInitiallyEmpty()
55 {
57 $this->assertEmpty($entity->getText());
58 }
59
64 {
66 $this->assertEmpty($entity->getSource());
67 }
68
73 {
75 $this->assertEmpty($entity->getSourceType());
76 }
77
82 {
84 $this->assertEmpty($entity->getIso2LanguageCode());
85 }
86
91 {
93 $this->assertEmpty($entity->getTimestamp());
94 }
95
99 public function testHashIsInitiallyEmpty()
100 {
101 $entity = new ilTermsOfServiceAcceptanceEntity();
102 $this->assertEmpty($entity->getHash());
103 }
104
109 {
110 $expected = 4711;
111
112 $entity = new ilTermsOfServiceAcceptanceEntity();
113 $entity->setId($expected);
114 $this->assertEquals($expected, $entity->getId());
115 }
116
121 {
122 $expected = 1337;
123
124 $entity = new ilTermsOfServiceAcceptanceEntity();
125 $entity->setUserId($expected);
126 $this->assertEquals($expected, $entity->getUserId());
127 }
128
133 {
134 $expected = 'Lorem Ipsum';
135
136 $entity = new ilTermsOfServiceAcceptanceEntity();
137 $entity->setText($expected);
138 $this->assertEquals($expected, $entity->getText());
139 }
140
145 {
146 $expected = '/path/to/file';
147
148 $entity = new ilTermsOfServiceAcceptanceEntity();
149 $entity->setSource($expected);
150 $this->assertEquals($expected, $entity->getSource());
151 }
152
157 {
158 $expected = 1;
159
160 $entity = new ilTermsOfServiceAcceptanceEntity();
161 $entity->setSourceType($expected);
162 $this->assertEquals($expected, $entity->getSourceType());
163 }
164
169 {
170 $expected = 'de';
171
172 $entity = new ilTermsOfServiceAcceptanceEntity();
173 $entity->setIso2LanguageCode($expected);
174 $this->assertEquals($expected, $entity->getIso2LanguageCode());
175 }
176
181 {
182 $expected = time();
183
184 $entity = new ilTermsOfServiceAcceptanceEntity();
185 $entity->setTimestamp($expected);
186 $this->assertEquals($expected, $entity->getTimestamp());
187 }
188
193 {
194 $expected = 'hash';
195
196 $entity = new ilTermsOfServiceAcceptanceEntity();
197 $entity->setHash($expected);
198 $this->assertEquals($expected, $entity->getHash());
199 }
200}