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 ( 0a6f96...b0c756 )
by Ross
12s queued 10s
created

GenerateFieldCommandTest::testGenerateEntity()   B

Complexity

Conditions 3
Paths 4

Size

Total Lines 30
Code Lines 18

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 3
eloc 18
nc 4
nop 0
dl 0
loc 30
rs 8.8571
c 0
b 0
f 0
1
<?php declare(strict_types=1);
2
3
namespace EdmondsCommerce\DoctrineStaticMeta\CodeGeneration\Command;
4
5
use Doctrine\Common\Util\Inflector;
6
use EdmondsCommerce\DoctrineStaticMeta\AbstractTest;
7
use EdmondsCommerce\DoctrineStaticMeta\CodeGeneration\Generator\AbstractGenerator;
8
use EdmondsCommerce\DoctrineStaticMeta\Exception\DoctrineStaticMetaException;
9
use EdmondsCommerce\DoctrineStaticMeta\MappingHelper;
10
11
class GenerateFieldCommandTest extends AbstractCommandTest
12
{
13
    public const WORK_DIR = AbstractTest::VAR_PATH.'/GenerateFieldCommandTest/';
14
15
    /**
16
     * @throws \Psr\Container\ContainerExceptionInterface
17
     * @throws \Psr\Container\NotFoundExceptionInterface
18
     * @throws DoctrineStaticMetaException
19
     * @SuppressWarnings(PHPMD.StaticAccess)
20
     */
21
    public function testGenerateField()
22
    {
23
        $command    = $this->container->get(GenerateFieldCommand::class);
24
        $tester     = $this->getCommandTester($command);
25
        $fieldsPath = self::WORK_DIR.'src/Entity/Fields';
26
        $namespace  = self::TEST_PROJECT_ROOT_NAMESPACE . AbstractGenerator::ENTITY_FIELD_TRAIT_NAMESPACE;
27
28
        $createdFiles = [];
29
30
        foreach (MappingHelper::COMMON_TYPES as $type) {
31
            $classy   = Inflector::classify($type);
32
            $fieldFqn = $namespace . "\\$classy\\$classy";
33
            $tester->execute(
34
                [
35
                    '-'.GenerateFieldCommand::OPT_PROJECT_ROOT_PATH_SHORT      => self::WORK_DIR,
36
                    '-'.GenerateFieldCommand::OPT_PROJECT_ROOT_NAMESPACE_SHORT => self::TEST_PROJECT_ROOT_NAMESPACE,
37
                    '-'.GenerateFieldCommand::OPT_FQN_SHORT                    => $fieldFqn,
38
                    '-'.GenerateFieldCommand::OPT_TYPE_SHORT                   => $type
39
                ]
40
            );
41
42
            $createdFiles[] = "$fieldsPath/Interfaces/$classy/{$classy}FieldInterface.php";
43
            $createdFiles[] = "$fieldsPath/Traits/$classy/{$classy}FieldTrait.php";
44
        }
45
46
        foreach ($createdFiles as $createdFile) {
47
            $this->assertNoMissedReplacements($createdFile);
48
        }
49
50
        $this->qaGeneratedCode();
51
    }
52
}
53