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

anonymous//tests/Small/Exception/ValidationExceptionTest.php$0   A

Complexity

Total Complexity 17

Size/Duplication

Total Lines 97
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 17
dl 0
loc 97
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A ValidationExceptionTest::getValidationErrors() 0 5 1
A ValidationExceptionTest::getInvalidEntity() 0 5 1
1
<?php declare(strict_types=1);
2
3
namespace EdmondsCommerce\DoctrineStaticMeta\Tests\Small\Exception;
4
5
use EdmondsCommerce\DoctrineStaticMeta\Exception\ValidationException;
6
use EdmondsCommerce\DoctrineStaticMeta\Tests\Assets\MockEntityFactory;
7
use PHPUnit\Framework\TestCase;
8
use Symfony\Component\Validator\ConstraintViolationList;
9
10
/**
11
 * Class ValidationExceptionTest
12
 *
13
 * @package EdmondsCommerce\DoctrineStaticMeta\Exception
14
 * @SuppressWarnings(PHPMD.UnusedLocalVariable)
15
 * @SuppressWarnings(PHPMD.StaticAccess)
16
 * @coversDefaultClass \EdmondsCommerce\DoctrineStaticMeta\Exception\ValidationException
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
    /**
30
     * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
31
     */
32
    public function setup()
33
    {
34
        try {
35
            $this->errors = new ConstraintViolationList();
36
            $this->entity = MockEntityFactory::createMockEntity();
37
            throw new ValidationException($this->errors, $this->entity);
38
        } catch (ValidationException $e) {
39
            $this->exception = $e;
40
        }
41
    }
42
43
    /**
44
     * @test
45
     * @small
46
     * @covers ::getInvalidEntity
47
     */
48
    public function getInvalidEntity(): void
49
    {
50
        $expected = $this->entity;
51
        $actual   = $this->exception->getInvalidEntity();
52
        self::assertSame($expected, $actual);
53
    }
54
55
    /**
56
     * @test
57
     * @small
58
     * @covers ::getValidationErrors
59
     */
60
    public function getValidationErrors(): void
61
    {
62
        $expected = $this->errors;
63
        $actual   = $this->exception->getValidationErrors();
64
        self::assertSame($expected, $actual);
65
    }
66
}
67