HelloJobTest::testSerialize()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 3
nc 1
nop 0
dl 0
loc 6
rs 10
c 1
b 0
f 1
1
<?php
2
declare(strict_types=1);
3
4
namespace JCIT\jobqueue\tests\unit\jobs;
5
6
use Codeception\Test\Unit;
7
use JCIT\jobqueue\jobs\HelloJob;
8
9
class HelloJobTest extends Unit
10
{
11
    public function testSerialize(): void
12
    {
13
        $name = 'Test';
14
        $job = new HelloJob($name);
15
16
        $this->assertEquals(['name' => $name], $job->jsonSerialize());
17
    }
18
19
    public function testDeserialize(): void
20
    {
21
        $name = 'Test';
22
        $serialization = ['name' => $name];
23
24
        $job = HelloJob::fromArray($serialization);
25
        $this->assertEquals($name, $job->getName());
26
    }
27
}
28