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 (#73)
by joseph
18:23
created

testGenerateRelationsNoFiltering()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 24
Code Lines 16

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 16
dl 0
loc 24
rs 9.7333
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php declare(strict_types=1);
2
3
namespace EdmondsCommerce\DoctrineStaticMeta\CodeGeneration\Command;
4
5
use EdmondsCommerce\DoctrineStaticMeta\AbstractIntegrationTest;
6
use EdmondsCommerce\DoctrineStaticMeta\CodeGeneration\Generator\RelationsGenerator;
7
use Symfony\Component\Finder\Finder;
8
9
class RemoveUnusedRelationsCommandTest extends AbstractCommandIntegrationTest
10
{
11
    public const WORK_DIR = AbstractIntegrationTest::VAR_PATH.'/'.self::TEST_TYPE.'/RemoveUnusedRelationsCommandTest/';
12
13
    public function testGenerateRelationsNoFiltering(): void
14
    {
15
        $entityFqns = $this->generateEntities();
16
        $this->getRelationsGenerator()->setEntityHasRelationToEntity(
17
            $entityFqns[0],
18
            RelationsGenerator::HAS_ONE_TO_ONE,
19
            $entityFqns[1]
20
        );
21
        $this->setupCopiedWorkDir();
22
        $command = $this->container->get(RemoveUnusedRelationsCommand::class);
23
        $tester  = $this->getCommandTester($command);
24
        $tester->execute(
25
            [
26
                '-'.RemoveUnusedRelationsCommand::OPT_PROJECT_ROOT_PATH_SHORT      => $this->copiedWorkDir,
27
                '-'.RemoveUnusedRelationsCommand::OPT_PROJECT_ROOT_NAMESPACE_SHORT => $this->getCopiedNamespaceRoot(),
28
            ]
29
        );
30
        $expectedFilesFoundCount = 10;
31
        $actualFilesFound        = $this->finderToArrayOfPaths(
32
            $this->finder()->files()->in(
33
                $this->copiedWorkDir.'/src/Entity/Relations/'
34
            )
35
        );
36
        self::assertCount($expectedFilesFoundCount, $actualFilesFound);
37
    }
38
39
    private function finder(): Finder
40
    {
41
        return new Finder();
42
    }
43
44
    private function finderToArrayOfPaths(Finder $finder): array
45
    {
46
        $return = [];
47
        foreach ($finder as $fileInfo) {
48
            $return[] = $fileInfo->getRealPath();
49
        }
50
51
        return $return;
52
    }
53
}
54