ILIAS  release_8 Revision v8.19-1-g4e8f2f9140c
All Data Structures Namespaces Files Functions Variables Modules Pages
ilTermsOfServiceAcceptanceEntityTest.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
26 {
27  public function testInstanceCanBeCreated(): void
28  {
29  $entity = new ilTermsOfServiceAcceptanceEntity();
30  $this->assertInstanceOf(ilTermsOfServiceAcceptanceEntity::class, $entity);
31  }
32 
33  public function testIdIsInitiallyEmpty(): void
34  {
35  $entity = new ilTermsOfServiceAcceptanceEntity();
36  $this->assertEmpty($entity->getId());
37  }
38 
39  public function testUserIdIsInitiallyEmpty(): void
40  {
41  $entity = new ilTermsOfServiceAcceptanceEntity();
42  $this->assertEmpty($entity->getUserId());
43  }
44 
45  public function testTextIsInitiallyEmpty(): void
46  {
47  $entity = new ilTermsOfServiceAcceptanceEntity();
48  $this->assertEmpty($entity->getText());
49  }
50 
51  public function testTitleIsInitiallyEmpty(): void
52  {
53  $entity = new ilTermsOfServiceAcceptanceEntity();
54  $this->assertEmpty($entity->getTitle());
55  }
56 
57  public function testDocumentIdIsInitiallyEmpty(): void
58  {
59  $entity = new ilTermsOfServiceAcceptanceEntity();
60  $this->assertEmpty($entity->getDocumentId());
61  }
62 
64  {
65  $entity = new ilTermsOfServiceAcceptanceEntity();
66  $this->assertEmpty($entity->getTimestamp());
67  }
68 
69  public function testHashIsInitiallyEmpty(): void
70  {
71  $entity = new ilTermsOfServiceAcceptanceEntity();
72  $this->assertEmpty($entity->getHash());
73  }
74 
75  public function testCriteriaAreInitiallyEmpty(): void
76  {
77  $entity = new ilTermsOfServiceAcceptanceEntity();
78  $this->assertEmpty($entity->getSerializedCriteria());
79  }
80 
81  public function testEntityShouldReturnIdWhenIdIsSet(): void
82  {
83  $expected = 4711;
84 
85  $entity = new ilTermsOfServiceAcceptanceEntity();
86  $this->assertSame($expected, $entity->withId($expected)->getId());
87  }
88 
90  {
91  $expected = 1337;
92 
93  $entity = new ilTermsOfServiceAcceptanceEntity();
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.
Class ilTermsOfServiceAcceptanceEntity.