Skip to content

Commit f74c3a7

Browse files
Revert "test: remove redundant test/assertion in CreatorTest (#185)"
This reverts commit 69a4fe1.
1 parent 9fd95c2 commit f74c3a7

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed

tests/src/Unit/CreatorTest.php

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace Deviantintegral\Har\Tests\Unit;
6+
7+
use Deviantintegral\Har\Creator;
8+
9+
/**
10+
* @covers \Deviantintegral\Har\Creator
11+
*/
12+
class CreatorTest extends HarTestBase
13+
{
14+
public function testSerialize(): void
15+
{
16+
$serializer = $this->getSerializer();
17+
$creator = (new Creator())
18+
->setName('CreatorTest')
19+
->setVersion('1.9')
20+
->setComment('Test case');
21+
$serialized = $serializer->serialize($creator, 'json');
22+
$this->assertEquals(
23+
[
24+
'name' => 'CreatorTest',
25+
'version' => '1.9',
26+
'comment' => 'Test case',
27+
],
28+
json_decode($serialized, true)
29+
);
30+
31+
$deserialized = $serializer->deserialize(
32+
$serialized,
33+
Creator::class,
34+
'json'
35+
);
36+
$this->assertEquals($creator, $deserialized);
37+
}
38+
39+
public function testGet(): void
40+
{
41+
$creator = (new Creator())
42+
->setName('CreatorTest')
43+
->setVersion('1.9')
44+
->setComment('Test case');
45+
46+
$this->assertEquals('CreatorTest', $creator->getName());
47+
$this->assertEquals('1.9', $creator->getVersion());
48+
$this->assertEquals('Test case', $creator->getComment());
49+
}
50+
}

0 commit comments

Comments
 (0)