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.
Passed
Pull Request — master (#153)
by joseph
05:42
created

itThrowsExceptionIfNoName()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 0
dl 0
loc 5
rs 10
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\CreateEmbeddableAction;
6
use EdmondsCommerce\DoctrineStaticMeta\Tests\Assets\AbstractTest;
7
8
/**
9
 * @medium
10
 * @covers \EdmondsCommerce\DoctrineStaticMeta\CodeGeneration\Action\CreateEmbeddableAction
11
 */
12
class CreateEmbeddableActionTest extends AbstractTest
13
{
14
    public const WORK_DIR = self::VAR_PATH . '/' . self::TEST_TYPE_MEDIUM . '/CreateEmbeddableActionTest';
15
16
    /**
17
     * @var CreateEmbeddableAction
18
     */
19
    private $action;
20
21
    public function setUp()
22
    {
23
        parent::setUp();
24
        $this->generateTestCode();
25
        $this->setupCopiedWorkDir();
26
        $this->action = $this->container->get(CreateEmbeddableAction::class);
27
        $this->action->setProjectRootDirectory($this->copiedWorkDir)
28
                     ->setProjectRootNamespace($this->copiedRootNamespace);
29
    }
30
31
    /**
32
     * @test
33
     */
34
    public function itCanCreateASkeleton(): void
35
    {
36
        $this->action->setCatName('Food')
37
                     ->setName('Cheese')
38
                     ->run();
39
40
        $expectedPaths = [
41
            'src/Entity/Embeddable/FakerData/Food/CheeseEmbeddableFakerData.php',
42
            'src/Entity/Embeddable/Interfaces/Objects/Food/CheeseEmbeddableInterface.php',
43
            'src/Entity/Embeddable/Interfaces/Food/HasCheeseEmbeddableInterface.php',
44
            'src/Entity/Embeddable/Objects/Food/CheeseEmbeddable.php',
45
            'src/Entity/Embeddable/Traits/Food/HasCheeseEmbeddableTrait.php',
46
        ];
47
        foreach ($expectedPaths as $path) {
48
            self::assertFileExists($this->copiedWorkDir . $path);
49
        }
50
    }
51
52
    /**
53
     * @test
54
     */
55
    public function itThrowsExceptionIfNoCatName(): void
56
    {
57
        $this->expectException(\RuntimeException::class);
58
        $this->action->setName('Cheese')
59
                     ->run();
60
    }
61
62
    /**
63
     * @test
64
     */
65
    public function itThrowsExceptionIfNoName(): void
66
    {
67
        $this->expectException(\RuntimeException::class);
68
        $this->action->setCatName('Cheese')
69
                     ->run();
70
    }
71
72
}