GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Pull Request — master (#131)
by joseph
33:18 queued 10:43
created

generateEntityWithoutUuid()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 23
Code Lines 13

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 13
nc 1
nop 0
dl 0
loc 23
rs 9.8333
c 0
b 0
f 0
1
<?php declare(strict_types=1);
2
3
namespace EdmondsCommerce\DoctrineStaticMeta\Tests\Large\CodeGeneration\Command;
4
5
use EdmondsCommerce\DoctrineStaticMeta\CodeGeneration\Command\GenerateEntityCommand;
6
use EdmondsCommerce\DoctrineStaticMeta\CodeGeneration\Generator\AbstractGenerator;
7
use EdmondsCommerce\DoctrineStaticMeta\Exception\DoctrineStaticMetaException;
8
use EdmondsCommerce\DoctrineStaticMeta\Tests\Assets\AbstractTest;
9
10
/**
11
 * Class GenerateEntityCommandTest
12
 *
13
 * @package EdmondsCommerce\DoctrineStaticMeta\Tests\Large\CodeGeneration\Command
14
 * @coversDefaultClass \EdmondsCommerce\DoctrineStaticMeta\CodeGeneration\Command\GenerateEntityCommand
15
 */
16
class GenerateEntityCommandTest extends AbstractCommandTest
17
{
18
    public const WORK_DIR = AbstractTest::VAR_PATH . '/' . self::TEST_TYPE_LARGE . '/GenerateEntityCommandTest/';
19
20
    /**
21
     * @test
22
     * @large
23
     * @covers ::execute
24
     * @throws \Psr\Container\ContainerExceptionInterface
25
     * @throws \Psr\Container\NotFoundExceptionInterface
26
     * @throws DoctrineStaticMetaException
27
     */
28
    public function generateEntity(): void
29
    {
30
        $command = $this->container->get(GenerateEntityCommand::class);
31
        $tester  = $this->getCommandTester($command);
32
        $tester->execute(
33
            [
34
                '-' . GenerateEntityCommand::OPT_PROJECT_ROOT_PATH_SHORT      => self::WORK_DIR,
35
                '-' . GenerateEntityCommand::OPT_PROJECT_ROOT_NAMESPACE_SHORT => self::TEST_PROJECT_ROOT_NAMESPACE,
36
                '-' . GenerateEntityCommand::OPT_FQN_SHORT                    => self::TEST_PROJECT_ROOT_NAMESPACE .
37
                                                                                 '\\'
38
                                                                                 .
39
                                                                                 AbstractGenerator::ENTITIES_FOLDER_NAME
40
                                                                                 .
41
                                                                                 '\\This\\Is\\A\\TestEntity',
42
            ]
43
        );
44
        $createdFiles = [
45
            $this->entitiesPath . '/This/Is/A/TestEntity.php',
46
            $this->entitiesPath . '/../../tests/Entities/This/Is/A/TestEntityTest.php',
47
        ];
48
        foreach ($createdFiles as $createdFile) {
49
            $this->assertNoMissedReplacements($createdFile);
50
        }
51
    }
52
53
    /**
54
     * @test
55
     * @large
56
     * @covers ::execute
57
     * @throws \Psr\Container\ContainerExceptionInterface
58
     * @throws \Psr\Container\NotFoundExceptionInterface
59
     * @throws DoctrineStaticMetaException
60
     */
61
    public function generateEntityWithoutUuid(): void
62
    {
63
        $command = $this->container->get(GenerateEntityCommand::class);
64
        $tester  = $this->getCommandTester($command);
65
        $tester->execute(
66
            [
67
                '-' . GenerateEntityCommand::OPT_PROJECT_ROOT_PATH_SHORT      => self::WORK_DIR,
68
                '-' . GenerateEntityCommand::OPT_PROJECT_ROOT_NAMESPACE_SHORT => self::TEST_PROJECT_ROOT_NAMESPACE,
69
                '-' . GenerateEntityCommand::OPT_FQN_SHORT                    => self::TEST_PROJECT_ROOT_NAMESPACE
70
                                                                                 .
71
                                                                                 '\\'
72
                                                                                 .
73
                                                                                 AbstractGenerator::ENTITIES_FOLDER_NAME
74
                                                                                 .
75
                                                                                 '\\This\\Is\\Another\\TestEntity',
76
                '-' . GenerateEntityCommand::OPT_INT_PRIMARY_KEY_SHORT        => true,
77
            ]
78
        );
79
80
        $entityPath = $this->entitiesPath . '/This/Is/Another/TestEntity.php';
81
82
        $this->assertNoMissedReplacements($entityPath);
83
        $this->assertFileContains($entityPath, 'IntegerIdFieldTrait');
84
    }
85
}
86