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
Push — master ( cc2797...f0d76c )
by joseph
02:00 queued 01:56
created

ionExceptionTest.php$0   A

Complexity

Total Complexity 12

Size/Duplication

Total Lines 59
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 12
dl 0
loc 59
rs 10
c 0
b 0
f 0
1
<?php declare(strict_types=1);
2
3
namespace EdmondsCommerce\DoctrineStaticMeta\Exception;
4
5
use Doctrine\ORM\Mapping\ClassMetadata as DoctrineClassMetaData;
6
use EdmondsCommerce\DoctrineStaticMeta\Entity\Interfaces\EntityInterface;
7
use EdmondsCommerce\DoctrineStaticMeta\Entity\Interfaces\Validation\EntityValidatorInterface;
8
use PHPUnit\Framework\TestCase;
9
use Symfony\Component\Validator\ConstraintViolationList;
10
use Symfony\Component\Validator\Mapping\ClassMetadata as ValidatorClassMetaData;
11
12
/**
13
 * Class ValidationExceptionTest
14
 *
15
 * @package EdmondsCommerce\DoctrineStaticMeta\Exception
16
 * @SuppressWarnings(PHPMD.UnusedLocalVariable)
17
 */
18
class ValidationExceptionTest extends TestCase
19
{
20
    /**
21
     * @var ValidationException
22
     */
23
    private $exception;
24
25
    private $errors;
26
27
    private $entity;
28
29
    public function setup()
30
    {
31
        try {
32
            $this->errors = new ConstraintViolationList();
33
            $this->entity = new class implements EntityInterface
34
            {
35
                public function getId()
36
                {
37
                    // TODO: Implement getId() method.
38
                }
39
40
                public static function loadMetadata(DoctrineClassMetaData $metadata): void
41
                {
42
                    // TODO: Implement loadMetadata() method.
43
                }
44
45
                public static function getPlural(): string
46
                {
47
                    return '';
48
                }
49
50
                public static function getSingular(): string
51
                {
52
                    return '';
53
                }
54
55
                public static function getIdField(): string
56
                {
57
                    return '';
58
                }
59
60
                public function getShortName(): string
61
                {
62
                    return '';
63
                }
64
65
                public function __toString(): string
66
                {
67
                    return '';
68
                }
69
70
                public static function loadValidatorMetaData(ValidatorClassMetaData $metadata): void
71
                {
72
                    // TODO: Implement loadValidatorMetaData() method.
73
                }
74
75
                public function injectValidator(EntityValidatorInterface $validator)
76
                {
77
                    // TODO: Implement injectValidator() method.
78
                }
79
80
                public function isValid(): bool
81
                {
82
                    return false;
83
                }
84
85
                public function validate()
86
                {
87
                    // TODO: Implement validate() method.
88
                }
89
90
                public function validateProperty(string $propertyName)
91
                {
92
                    // TODO: Implement validateProperty() method.
93
                }
94
95
96
            };
97
            throw new ValidationException($this->errors, $this->entity);
98
        } catch (ValidationException $e) {
99
            $this->exception = $e;
100
        }
101
    }
102
103
    public function testGetInvalidEntity()
104
    {
105
        $expected = $this->entity;
106
        $actual   = $this->exception->getInvalidEntity();
107
        $this->assertSame($expected, $actual);
108
    }
109
110
    public function testGetValidationErrors()
111
    {
112
        $expected = $this->errors;
113
        $actual   = $this->exception->getValidationErrors();
114
        $this->assertSame($expected, $actual);
115
    }
116
}
117