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 (#153)
by joseph
07:15
created

HasEmbeddableInterfaceCreatorTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 46
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 20
dl 0
loc 46
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getCreator() 0 15 1
A itCanCreateTheFile() 0 10 1
1
<?php declare(strict_types=1);
2
3
namespace EdmondsCommerce\DoctrineStaticMeta\Tests\Small\CodeGeneration\Creation\Src\Entity\Embeddable\Interfaces;
4
5
use EdmondsCommerce\DoctrineStaticMeta\CodeGeneration\Creation\Src\Entity\Embeddable\Interfaces\HasEmbeddableInterfaceCreator;
6
use EdmondsCommerce\DoctrineStaticMeta\CodeGeneration\Filesystem\Factory\FileFactory;
7
use EdmondsCommerce\DoctrineStaticMeta\CodeGeneration\Filesystem\Factory\FindReplaceFactory;
8
use EdmondsCommerce\DoctrineStaticMeta\CodeGeneration\Filesystem\File\Writer;
9
use EdmondsCommerce\DoctrineStaticMeta\CodeGeneration\NamespaceHelper;
10
use EdmondsCommerce\DoctrineStaticMeta\Config;
11
use EdmondsCommerce\DoctrineStaticMeta\Tests\Small\ConfigTest;
12
use PHPUnit\Framework\TestCase;
13
14
class HasEmbeddableInterfaceCreatorTest extends TestCase
15
{
16
    private const EXPECTED_FILE = "<?php declare(strict_types=1);
17
18
namespace Test\Project\Entity\Embeddable\Interfaces\Foo;
19
20
use Test\Project\Entity\Embeddable\Interfaces\Objects\Foo\BarEmbeddableInterface;
21
22
interface HasBarEmbeddableInterface
23
{
24
    public const PROP_BAR_EMBEDDABLE = 'barEmbeddable';
25
    public const COLUMN_PREFIX_BAR   = 'bar_';
26
27
    public function getBarEmbeddable(): BarEmbeddableInterface;
28
}";
29
30
    /**
31
     * @test
32
     */
33
    public function itCanCreateTheFile(): void
34
    {
35
        $file     = $this->getCreator()
36
                         ->setCatName('Foo')
37
                         ->setName('Bar')
38
                         ->createTargetFileObject()
39
                         ->getTargetFile();
40
        $expected = self::EXPECTED_FILE;
41
        $actual   = $file->getContents();
42
        self::assertSame($expected, $actual);
43
    }
44
45
    private function getCreator(): HasEmbeddableInterfaceCreator
46
    {
47
        $namespaceHelper = new NamespaceHelper();
48
        $config          = new Config(ConfigTest::SERVER);
49
50
        $creator = new HasEmbeddableInterfaceCreator(
51
            new FileFactory($namespaceHelper, $config),
52
            $namespaceHelper,
53
            new Writer(),
54
            $config,
55
            new FindReplaceFactory()
56
        );
57
        $creator->setProjectRootNamespace('Test\Project');
58
59
        return $creator;
60
    }
61
}