ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilTermsOfServiceAcceptanceEntityTest.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2018 ILIAS open source, Extended GPL, see docs/LICENSE */
3
9{
13 public function testInstanceCanBeCreated()
14 {
15 $entity = new \ilTermsOfServiceAcceptanceEntity();
16 $this->assertInstanceOf(\ilTermsOfServiceAcceptanceEntity::class, $entity);
17 }
18
22 public function testIdIsInitiallyEmpty()
23 {
24 $entity = new \ilTermsOfServiceAcceptanceEntity();
25 $this->assertEmpty($entity->getId());
26 }
27
32 {
33 $entity = new \ilTermsOfServiceAcceptanceEntity();
34 $this->assertEmpty($entity->getUserId());
35 }
36
40 public function testTextIsInitiallyEmpty()
41 {
42 $entity = new \ilTermsOfServiceAcceptanceEntity();
43 $this->assertEmpty($entity->getText());
44 }
45
49 public function testTitleIsInitiallyEmpty()
50 {
51 $entity = new \ilTermsOfServiceAcceptanceEntity();
52 $this->assertEmpty($entity->getTitle());
53 }
54
59 {
60 $entity = new \ilTermsOfServiceAcceptanceEntity();
61 $this->assertEmpty($entity->getDocumentId());
62 }
63
68 {
69 $entity = new \ilTermsOfServiceAcceptanceEntity();
70 $this->assertEmpty($entity->getTimestamp());
71 }
72
76 public function testHashIsInitiallyEmpty()
77 {
78 $entity = new \ilTermsOfServiceAcceptanceEntity();
79 $this->assertEmpty($entity->getHash());
80 }
81
86 {
87 $entity = new \ilTermsOfServiceAcceptanceEntity();
88 $this->assertEmpty($entity->getSerializedCriteria());
89 }
90
95 {
96 $expected = 4711;
97
98 $entity = new \ilTermsOfServiceAcceptanceEntity();
99 $this->assertEquals($expected, $entity->withId($expected)->getId());
100 }
101
106 {
107 $expected = 1337;
108
109 $entity = new \ilTermsOfServiceAcceptanceEntity();
110 $this->assertEquals($expected, $entity->withUserId($expected)->getUserId());
111 }
112
117 {
118 $expected = 'Lorem Ipsum';
119
120 $entity = new \ilTermsOfServiceAcceptanceEntity();
121 $this->assertEquals($expected, $entity->withText($expected)->getText());
122 }
123
128 {
129 $expected = 4711;
130
131 $entity = new \ilTermsOfServiceAcceptanceEntity();
132 $this->assertEquals($expected, $entity->withDocumentId($expected)->getDocumentId());
133 }
134
139 {
140 $expected = 'Document PHP Unit';
141
142 $entity = new \ilTermsOfServiceAcceptanceEntity();
143 $this->assertEquals($expected, $entity->withTitle($expected)->getTitle());
144 }
145
150 {
151 $expected = time();
152
153 $entity = new \ilTermsOfServiceAcceptanceEntity();
154 $this->assertEquals($expected, $entity->withTimestamp($expected)->getTimestamp());
155 }
156
161 {
162 $expected = 'hash';
163
164 $entity = new \ilTermsOfServiceAcceptanceEntity();
165 $this->assertEquals($expected, $entity->withHash($expected)->getHash());
166 }
167
172 {
173 $expected = 'criteria';
174
175 $entity = new \ilTermsOfServiceAcceptanceEntity();
176 $this->assertEquals($expected, $entity->withSerializedCriteria($expected)->getSerializedCriteria());
177 }
178}
An exception for terminatinating execution or to throw for unit testing.
Class ilTermsOfServiceAcceptanceEntityTest.
Class ilTermsOfServiceBaseTest.