Passed
Push — master ( 9ff768...b736eb )
by Laurens
02:33
created

CategoryTest::new()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 9
rs 9.6666
c 0
b 0
f 0
cc 1
eloc 6
nc 1
nop 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace LauLamanApps\IzettleApi\Tests\Unit\Api\Product;
6
7
use LauLamanApps\IzettleApi\API\Product\Category;
8
use PHPUnit\Framework\TestCase;
9
use Ramsey\Uuid\Uuid;
10
11
/** * @small */
12
final class CategoryTest extends TestCase
13
{
14
    /** @test */
15
    public function new(): void
16
    {
17
        $name = 'name';
18
        $discount = Category::new($name);
19
20
        $createData = json_decode($discount->getCreateData(), true);
21
        self::assertTrue(Uuid::isValid($createData['uuid']));
22
        self::assertSame($name, $createData['name']);
23
    }
24
}
25