Completed
Push — master ( 20d2a7...83241b )
by Anton
01:20
created

JobTest::it_can_instantiate_from_array()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 16

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 16
rs 9.7333
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
/*
4
 * This file is part of Laravel Paket.
5
 *
6
 * (c) Anton Komarev <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
declare(strict_types=1);
13
14
namespace Cog\Tests\Laravel\Paket\Unit\Job\Entities;
15
16
use Cog\Laravel\Paket\Job\Entities\Job;
17
use Cog\Tests\Laravel\Paket\TestCase;
18
use Illuminate\Support\Carbon;
19
20
final class JobTest extends TestCase
21
{
22
    /** @test */
23
    public function it_can_instantiate_from_array(): void
24
    {
25
        $job = Job::fromArray([
26
            'type' => 'TestType',
27
            'id' => 'TestId',
28
            'status' => 'TestStatus',
29
            'process' => [],
30
            'requirement' => [
31
                'name' => 'cybercog/laravel-paket',
32
            ],
33
            'createdAt' => Carbon::now()->format(DATE_RFC3339_EXTENDED),
34
        ]);
35
36
        $this->assertInstanceOf(Job::class, $job);
37
        $this->assertSame('TestType', $job->getType());
38
    }
39
}
40