SymfonyUuidIdentityGeneratorTest::setUp()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 3
dl 0
loc 6
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Gember\IdentityGeneratorSymfony\Test\Uuid;
6
7
use Gember\IdentityGeneratorSymfony\Uuid\SymfonyUuidIdentityGenerator;
0 ignored issues
show
Bug introduced by
The type Gember\IdentityGenerator...nyUuidIdentityGenerator was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
8
use PHPUnit\Framework\Attributes\Test;
0 ignored issues
show
Bug introduced by
The type PHPUnit\Framework\Attributes\Test was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
9
use PHPUnit\Framework\TestCase;
10
use Symfony\Component\Uid\Factory\UuidFactory;
11
12
/**
13
 * @internal
14
 */
15
final class SymfonyUuidIdentityGeneratorTest extends TestCase
16
{
17
    private SymfonyUuidIdentityGenerator $identityGenerator;
18
19
    protected function setUp(): void
20
    {
21
        parent::setUp();
22
23
        $this->identityGenerator = new SymfonyUuidIdentityGenerator(
24
            new UuidFactory(),
25
        );
26
    }
27
28
    #[Test]
29
    public function itShouldGenerateUuid(): void
30
    {
31
        $uuid = $this->identityGenerator->generate();
32
33
        self::assertMatchesRegularExpression(
34
            '#^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{12}$#',
35
            $uuid,
36
        );
37
    }
38
}
39