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
Push — master ( 75bdf9...8faa57 )
by joseph
83:56 queued 81:04
created

CreateEntityActionTest::itCanCreateANestedEntity()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 17
Code Lines 15

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 15
nc 2
nop 0
dl 0
loc 17
rs 9.7666
c 0
b 0
f 0
1
<?php declare(strict_types=1);
2
3
namespace EdmondsCommerce\DoctrineStaticMeta\Tests\Medium\CodeGeneration\Action;
4
5
use EdmondsCommerce\DoctrineStaticMeta\CodeGeneration\Action\CreateEntityAction;
6
use EdmondsCommerce\DoctrineStaticMeta\Tests\Assets\AbstractTest;
7
8
/**
9
 * @covers \EdmondsCommerce\DoctrineStaticMeta\CodeGeneration\Action\CreateEntityAction
10
 * @medium
11
 */
12
class CreateEntityActionTest extends AbstractTest
13
{
14
    public const WORK_DIR = AbstractTest::VAR_PATH . '/' . AbstractTest::TEST_TYPE_MEDIUM
15
                            . '/CreateEntityActionTest';
16
17
    private const TEST_ENTITY = self::TEST_ENTITIES_ROOT_NAMESPACE . '\\ActionEntity';
18
19
    private const TEST_ENTITY_NESTED = self::TEST_ENTITIES_ROOT_NAMESPACE .
20
                                       '\\Nested\\Blah\\Blah\\Foo\\ActionEntity';
21
22
    /**
23
     * @test
24
     */
25
    public function itCanCreateAnEntity(): void
26
    {
27
        $this->getAction()->setEntityFqn(self::TEST_ENTITY)->run();
28
        foreach ([
29
                     self::WORK_DIR . '/src/Entities/ActionEntity.php',
30
                     self::WORK_DIR . '/src/Entity/Factories/AbstractEntityFactory.php',
31
                     self::WORK_DIR . '/src/Entity/Factories/ActionEntityFactory.php',
32
                     self::WORK_DIR . '/src/Entity/Interfaces/ActionEntityInterface.php',
33
                     self::WORK_DIR . '/src/Entity/Repositories/AbstractEntityRepository.php',
34
                     self::WORK_DIR . '/src/Entity/Repositories/ActionEntityRepository.php',
35
                     self::WORK_DIR . '/tests/Assets/Entity/Fixtures/ActionEntityFixture.php',
36
                     self::WORK_DIR . '/tests/Entities/AbstractEntityTest.php',
37
                     self::WORK_DIR . '/tests/Entities/ActionEntityTest.php',
38
                 ] as $expectedFilePath) {
39
            self::assertFileExists($expectedFilePath);
40
        }
41
    }
42
43
    private function getAction(): CreateEntityAction
44
    {
45
        /**
46
         * @var CreateEntityAction $action
47
         */
48
        $action = $this->container->get(CreateEntityAction::class)
49
                                  ->setProjectRootDirectory(self::WORK_DIR)
50
                                  ->setProjectRootNamespace(self::TEST_PROJECT_ROOT_NAMESPACE);
51
52
        return $action;
53
    }
54
55
    /**
56
     * @test
57
     */
58
    public function itCanCreateANestedEntity(): void
59
    {
60
        $this->getAction()->setEntityFqn(self::TEST_ENTITY_NESTED)->run();
61
        foreach ([
62
                     self::WORK_DIR . '/src/Entities/Nested/Blah/Blah/Foo/ActionEntity.php',
63
                     self::WORK_DIR . '/src/Entity/Factories/AbstractEntityFactory.php',
64
                     self::WORK_DIR . '/src/Entity/Factories/Nested/Blah/Blah/Foo/ActionEntityFactory.php',
65
                     self::WORK_DIR . '/src/Entity/Interfaces/Nested/Blah/Blah/Foo/ActionEntityInterface.php',
66
                     self::WORK_DIR . '/src/Entity/Repositories/AbstractEntityRepository.php',
67
                     self::WORK_DIR .
68
                     '/src/Entity/Repositories/Nested/Blah/Blah/Foo/ActionEntityRepository.php',
69
                     self::WORK_DIR .
70
                     '/tests/Assets/Entity/Fixtures/Nested/Blah/Blah/Foo/ActionEntityFixture.php',
71
                     self::WORK_DIR . '/tests/Entities/AbstractEntityTest.php',
72
                     self::WORK_DIR . '/tests/Entities/Nested/Blah/Blah/Foo/ActionEntityTest.php',
73
                 ] as $expectedFilePath) {
74
            self::assertFileExists($expectedFilePath);
75
        }
76
    }
77
}
78