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 (#51)
by joseph
102:38 queued 99:24
created

IdFieldTraitTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
dl 0
loc 28
c 0
b 0
f 0
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A generateCode() 0 5 1
A testCreateEntityWithField() 0 8 1
1
<?php declare(strict_types=1);
2
3
namespace EdmondsCommerce\DoctrineStaticMeta\Entity\Fields\Traits\PrimaryKey;
4
5
use EdmondsCommerce\DoctrineStaticMeta\AbstractTest;
6
use EdmondsCommerce\DoctrineStaticMeta\Entity\Fields\Interfaces\PrimaryKey\IdFieldInterface;
7
use EdmondsCommerce\DoctrineStaticMeta\Entity\Fields\Traits\AbstractFieldTraitTest;
8
9
class IdFieldTraitTest extends AbstractFieldTraitTest
10
{
11
    public const    WORK_DIR        = AbstractTest::VAR_PATH.'/IdFieldTraitTest/';
12
    protected const TEST_FIELD_FQN  = IdFieldTrait::class;
13
    protected const TEST_FIELD_PROP = IdFieldInterface::PROP_ID;
14
15
    public function generateCode()
16
    {
17
        $this->getEntityGenerator()
18
             ->generateEntity(static::TEST_ENTITY_FQN_BASE.$this->entitySuffix);
19
        $this->setupCopiedWorkDir();
20
    }
21
22
23
    /**
24
     * Can't really do setters etc on ID fields
25
     *
26
     * @throws \EdmondsCommerce\DoctrineStaticMeta\Exception\DoctrineStaticMetaException
27
     * @throws \ReflectionException
28
     */
29
    public function testCreateEntityWithField(): void
30
    {
31
        $entityFqn = $this->getCopiedFqn(static::TEST_ENTITY_FQN_BASE.$this->entitySuffix);
32
        $entity    = new $entityFqn();
33
        $getter    = $this->getGetter($entity);
34
        $this->assertTrue(\method_exists($entity, $getter));
35
        $value = $entity->$getter();
36
        $this->assertEmpty($value);
37
    }
38
}
39