Completed
Pull Request — master (#11)
by Laurens
01:46
created

CategoryTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

Changes 0
Metric Value
wmc 1
lcom 1
cbo 3
dl 0
loc 13
rs 10
c 0
b 0
f 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