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 (#75)
by joseph
14:44
created

itCanGetAndSetAllTheThings()

Size

Total Lines 34
Code Lines 22

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 22
dl 0
loc 34
c 0
b 0
f 0
nc 2
nop 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A FullNameEmbeddableTest.php$0 ➔ __construct() 0 3 1
1
<?php declare(strict_types=1);
2
3
namespace EdmondsCommerce\DoctrineStaticMeta\Entity\Embeddable\Objects\Identity;
4
5
use Doctrine\ORM\Mapping\ClassMetadata;
6
use EdmondsCommerce\DoctrineStaticMeta\Entity\Embeddable\Interfaces\Objects\Identity\FullNameEmbeddableInterface;
7
use EdmondsCommerce\DoctrineStaticMeta\Entity\Interfaces\ImplementNotifyChangeTrackingPolicyInterface;
8
use EdmondsCommerce\DoctrineStaticMeta\Entity\Traits\ImplementNotifyChangeTrackingPolicy;
9
use PHPUnit\Framework\TestCase;
10
11
/**
12
 * Class FullNameEmbeddableTest
13
 *
14
 * @package EdmondsCommerce\DoctrineStaticMeta\Entity\Embeddable\Objects\Identity
15
 * @SuppressWarnings(PHPMD.UnusedLocalVariable)
16
 */
17
class FullNameEmbeddableTest extends TestCase
18
{
19
    /**
20
     * @test
21
     * @small
22
     * @covers \EdmondsCommerce\DoctrineStaticMeta\Entity\Embeddable\Objects\Identity\FullNameEmbeddable::<public>
23
     */
24
    public function itCanGetAndSetAllTheThings(): void
25
    {
26
        $expected   = [
27
            FullNameEmbeddableInterface::EMBEDDED_PROP_TITLE       => 'Sir',
28
            FullNameEmbeddableInterface::EMBEDDED_PROP_FIRSTNAME   => 'Roger',
29
            FullNameEmbeddableInterface::EMBEDDED_PROP_MIDDLENAMES => [
30
                'Michael',
31
                'Stephen',
32
                "O'Neil",
33
            ],
34
            FullNameEmbeddableInterface::EMBEDDED_PROP_LASTNAME    => 'Marmaduke',
35
            FullNameEmbeddableInterface::EMBEDDED_PROP_SUFFIX      => 'The Third',
36
        ];
37
        $embeddable = new FullNameEmbeddable();
38
        $embeddable->setOwningEntity(new class() implements ImplementNotifyChangeTrackingPolicyInterface
39
        {
40
            private static $metaData;
41
42
            public function __construct()
43
            {
44
                self::$metaData = new ClassMetadata('anon');
45
            }
46
47
            use ImplementNotifyChangeTrackingPolicy;
48
        });
49
        $actual = [];
50
        foreach ($expected as $property => $value) {
51
            $setter = "set$property";
52
            $getter = "get$property";
53
            $embeddable->$setter($value);
54
            $actual[$property] = $embeddable->$getter();
55
        }
56
        self::assertSame($expected, $actual);
57
        self::assertSame('Sir Roger Michael Stephen O\'Neil Marmaduke The Third', $embeddable->getFormatted());
58
    }
59
}
60