16 use PHPUnit\Framework\TestCase;
29 protected function setUp(): void
33 'name' =>
'Test Comment',
34 'comment' =>
'This is a test standard comment',
49 $this->sampleData[
'id'],
50 $this->sampleData[
'name'],
51 $this->sampleData[
'comment'],
52 $this->sampleData[
'isEnabled']
54 $this->assertInstanceOf(LicenseStandardComment::class, $standardComment);
66 $this->assertEquals($this->sampleData[
'id'], $standardComment->getId());
77 $this->assertEquals($this->sampleData[
'name'], $standardComment->getName());
88 $this->assertEquals($this->sampleData[
'comment'], $standardComment->getComment());
99 $this->assertTrue($standardComment->getIsEnabled());
111 $standardComment->setId(2);
112 $this->assertEquals(2, $standardComment->getId());
122 $standardComment->setName(
'Updated Name');
123 $this->assertEquals(
'Updated Name', $standardComment->getName());
133 $standardComment->setComment(
'Updated Comment');
134 $this->assertEquals(
'Updated Comment', $standardComment->getComment());
144 $standardComment->setIsEnabled(
true);
145 $this->assertTrue($standardComment->getIsEnabled());
155 $this->sampleData[
'id'],
156 $this->sampleData[
'name'],
157 $this->sampleData[
'comment'],
158 $this->sampleData[
'isEnabled']
161 'id' => $this->sampleData[
'id'],
162 'name' => $this->sampleData[
'name'],
163 'comment' => $this->sampleData[
'comment'],
164 'is_enabled' => $this->sampleData[
'isEnabled']
166 $this->assertEquals($expectedArray, $standardComment->getArray(ApiVersion::V1));
176 $this->sampleData[
'id'],
177 $this->sampleData[
'name'],
178 $this->sampleData[
'comment'],
179 $this->sampleData[
'isEnabled']
182 'id' => $this->sampleData[
'id'],
183 'name' => $this->sampleData[
'name'],
184 'comment' => $this->sampleData[
'comment'],
185 'isEnabled' => $this->sampleData[
'isEnabled']
187 $this->assertEquals($expectedArray, $standardComment->getArray(ApiVersion::V2));
197 $this->sampleData[
'id'],
198 $this->sampleData[
'name'],
199 $this->sampleData[
'comment'],
200 $this->sampleData[
'isEnabled']
202 $json = $standardComment->getJSON(ApiVersion::V1);
203 $this->assertIsString($json);
204 $this->assertEquals(json_decode($json,
true), $standardComment->getArray(ApiVersion::V1));
214 $this->sampleData[
'id'],
215 $this->sampleData[
'name'],
216 $this->sampleData[
'comment'],
217 $this->sampleData[
'isEnabled']
219 $json = $standardComment->getJSON(ApiVersion::V2);
220 $this->assertIsString($json);
221 $this->assertEquals(json_decode($json,
true), $standardComment->getArray(ApiVersion::V2));
231 $this->assertEquals(0, $standardComment->getId());
232 $this->assertEquals(
'', $standardComment->getName());
233 $this->assertEquals(
'', $standardComment->getComment());
234 $this->assertFalse($standardComment->getIsEnabled());