ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
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 
4 require_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  {
29  $entity = new ilTermsOfServiceAcceptanceEntity();
30  $this->assertInstanceOf('ilTermsOfServiceAcceptanceEntity', $entity);
31  }
32 
36  public function testIdIsInitiallyEmpty()
37  {
38  $entity = new ilTermsOfServiceAcceptanceEntity();
39  $this->assertEmpty($entity->getId());
40  }
41 
45  public function testUserIdIsInitiallyEmpty()
46  {
47  $entity = new ilTermsOfServiceAcceptanceEntity();
48  $this->assertEmpty($entity->getUserId());
49  }
50 
54  public function testTextIsInitiallyEmpty()
55  {
56  $entity = new ilTermsOfServiceAcceptanceEntity();
57  $this->assertEmpty($entity->getText());
58  }
59 
63  public function testSourceIsInitiallyEmpty()
64  {
65  $entity = new ilTermsOfServiceAcceptanceEntity();
66  $this->assertEmpty($entity->getSource());
67  }
68 
73  {
74  $entity = new ilTermsOfServiceAcceptanceEntity();
75  $this->assertEmpty($entity->getSourceType());
76  }
77 
82  {
83  $entity = new ilTermsOfServiceAcceptanceEntity();
84  $this->assertEmpty($entity->getIso2LanguageCode());
85  }
86 
91  {
92  $entity = new ilTermsOfServiceAcceptanceEntity();
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 }