Completed
Push — master ( 3bf82a...4bb2b6 )
by Kamil
22:52
created

DisabledSpec   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 5
lcom 0
cbo 1
dl 0
loc 27
rs 10
c 0
b 0
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A it_is_initializable() 0 4 1
A it_is_constraint() 0 4 1
A it_is_a_property_constraint() 0 4 1
A it_is_a_class_constraint() 0 4 1
A it_is_validated_by_disabled_validator() 0 4 1
1
<?php
2
3
/*
4
 * This file is part of the Sylius package.
5
 *
6
 * (c) Paweł Jędrzejewski
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace spec\Sylius\Bundle\ResourceBundle\Validator\Constraints;
13
14
use PhpSpec\ObjectBehavior;
15
use Sylius\Bundle\ResourceBundle\Validator\Constraints\Disabled;
16
use Sylius\Bundle\ResourceBundle\Validator\DisabledValidator;
17
use Symfony\Component\Validator\Constraint;
18
19
/**
20
 * @author Kamil Kokot <[email protected]>
21
 */
22
final class DisabledSpec extends ObjectBehavior
23
{
24
    function it_is_initializable()
25
    {
26
        $this->shouldHaveType(Disabled::class);
27
    }
28
29
    function it_is_constraint()
30
    {
31
        $this->shouldHaveType(Constraint::class);
32
    }
33
34
    function it_is_a_property_constraint()
35
    {
36
        $this->getTargets()->shouldContain(Constraint::PROPERTY_CONSTRAINT);
37
    }
38
39
    function it_is_a_class_constraint()
40
    {
41
        $this->getTargets()->shouldContain(Constraint::CLASS_CONSTRAINT);
42
    }
43
44
    function it_is_validated_by_disabled_validator()
45
    {
46
        $this->validatedBy()->shouldReturn(DisabledValidator::class);
47
    }
48
}
49