ILIAS  release_8 Revision v8.24
ilTermsOfServiceAcceptanceEntityTest.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
26{
27 public function testInstanceCanBeCreated(): void
28 {
30 $this->assertInstanceOf(ilTermsOfServiceAcceptanceEntity::class, $entity);
31 }
32
33 public function testIdIsInitiallyEmpty(): void
34 {
36 $this->assertEmpty($entity->getId());
37 }
38
39 public function testUserIdIsInitiallyEmpty(): void
40 {
42 $this->assertEmpty($entity->getUserId());
43 }
44
45 public function testTextIsInitiallyEmpty(): void
46 {
48 $this->assertEmpty($entity->getText());
49 }
50
51 public function testTitleIsInitiallyEmpty(): void
52 {
54 $this->assertEmpty($entity->getTitle());
55 }
56
57 public function testDocumentIdIsInitiallyEmpty(): void
58 {
60 $this->assertEmpty($entity->getDocumentId());
61 }
62
64 {
66 $this->assertEmpty($entity->getTimestamp());
67 }
68
69 public function testHashIsInitiallyEmpty(): void
70 {
72 $this->assertEmpty($entity->getHash());
73 }
74
75 public function testCriteriaAreInitiallyEmpty(): void
76 {
78 $this->assertEmpty($entity->getSerializedCriteria());
79 }
80
82 {
83 $expected = 4711;
84
86 $this->assertSame($expected, $entity->withId($expected)->getId());
87 }
88
90 {
91 $expected = 1337;
92
94 $this->assertSame($expected, $entity->withUserId($expected)->getUserId());
95 }
96
98 {
99 $expected = 'Lorem Ipsum';
100
101 $entity = new ilTermsOfServiceAcceptanceEntity();
102 $this->assertSame($expected, $entity->withText($expected)->getText());
103 }
104
106 {
107 $expected = 4711;
108
109 $entity = new ilTermsOfServiceAcceptanceEntity();
110 $this->assertSame($expected, $entity->withDocumentId($expected)->getDocumentId());
111 }
112
114 {
115 $expected = 'Document PHP Unit';
116
117 $entity = new ilTermsOfServiceAcceptanceEntity();
118 $this->assertSame($expected, $entity->withTitle($expected)->getTitle());
119 }
120
122 {
123 $expected = time();
124
125 $entity = new ilTermsOfServiceAcceptanceEntity();
126 $this->assertSame($expected, $entity->withTimestamp($expected)->getTimestamp());
127 }
128
130 {
131 $expected = 'hash';
132
133 $entity = new ilTermsOfServiceAcceptanceEntity();
134 $this->assertSame($expected, $entity->withHash($expected)->getHash());
135 }
136
138 {
139 $expected = 'criteria';
140
141 $entity = new ilTermsOfServiceAcceptanceEntity();
142 $this->assertSame($expected, $entity->withSerializedCriteria($expected)->getSerializedCriteria());
143 }
144}
Class ilTermsOfServiceAcceptanceEntityTest.
Class ilTermsOfServiceBaseTest.