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 ( f20003...f7764e )
by Ross
17s queued 11s
created

violationsForInvalidValues()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 5
nc 1
nop 1
dl 0
loc 8
rs 10
c 0
b 0
f 0
1
<?php declare(strict_types=1);
2
3
namespace EdmondsCommerce\DoctrineStaticMeta\Tests\Small\Validation\Constraints\FieldConstraints;
4
5
use EdmondsCommerce\DoctrineStaticMeta\Entity\Validation\Constraints\FieldConstraints\DomainName;
6
use EdmondsCommerce\DoctrineStaticMeta\Entity\Validation\Constraints\FieldConstraints\DomainNameValidator;
7
use Symfony\Component\Validator\Test\ConstraintValidatorTestCase;
8
9
/**
10
 * @small
11
 * @covers \EdmondsCommerce\DoctrineStaticMeta\Entity\Validation\Constraints\FieldConstraints\DomainNameValidator
12
 */
13
class DomainNameValidatorTest extends ConstraintValidatorTestCase
14
{
15
    public const VALID = [
16
        'domainname.com' .
17
        'edmondscommerce.co.uk',
18
        'www.edmondscommerce.co.uk',
19
    ];
20
21
    public const INVALID = [
22
        'nodots',
23
        '//isurl.com',
24
        '999',
25
    ];
26
27
    public function provideValid(): \Generator
28
    {
29
        foreach (self::VALID as $value) {
30
            yield $value => [$value];
31
        }
32
    }
33
34
    /**
35
     * @test
36
     * @small
37
     *
38
     * @param string $value
39
     *
40
     * @dataProvider provideValid
41
     */
42
    public function noViolationsForValidValues(string $value): void
43
    {
44
        $this->validator->validate($value, new DomainName());
45
46
        $this->assertNoViolation();
47
    }
48
49
    public function provideInvalid(): \Generator
50
    {
51
        foreach (self::INVALID as $value) {
52
            yield $value => [$value];
53
        }
54
    }
55
56
    /**
57
     * @test
58
     * @small
59
     *
60
     * @param string $value
61
     *
62
     * @dataProvider provideInvalid
63
     */
64
    public function violationsForInvalidValues(string $value): void
65
    {
66
        $this->validator->validate($value, new DomainName());
67
68
        $this->buildViolation(sprintf(DomainName::MESSAGE, '"' . $value . '"'))
69
             ->setParameter('{{ value }}', '"' . $value . '"')
70
             ->setCode(DomainName::INVALID_DOMAIN_ERROR)
71
             ->assertRaised();
72
    }
73
74
    protected function createValidator()
75
    {
76
        return new DomainNameValidator();
77
    }
78
}
79