Total Complexity | 7 |
Total Lines | 35 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
11 | final class ConstantSpec extends ObjectBehavior |
||
12 | { |
||
13 | function it_is_initializable() |
||
|
|||
14 | { |
||
15 | $this->shouldHaveType(Constant::class); |
||
16 | } |
||
17 | |||
18 | function it_doesnt_support_non_constant_pattern_values() |
||
19 | { |
||
20 | $this->supports('foo')->shouldReturn(false); |
||
21 | } |
||
22 | |||
23 | function it_doesnt_support_integers() |
||
24 | { |
||
25 | $this->supports(0)->shouldReturn(false); |
||
26 | } |
||
27 | |||
28 | function it_doesnt_support_non_existing_classes() |
||
29 | { |
||
30 | $this->supports('My\Awesome\Non\Existing\Class::CONST')->shouldReturn(false); |
||
31 | } |
||
32 | |||
33 | function it_doesnt_support_non_existing_constants() |
||
34 | { |
||
35 | $this->supports(Dictionary::class.'::PONEY')->shouldReturn(false); |
||
36 | } |
||
37 | |||
38 | function it_supports_existing_classes_and_constants() |
||
39 | { |
||
40 | $this->supports(Dictionary::class.'::VALUE')->shouldReturn(true); |
||
41 | } |
||
42 | |||
43 | function it_transforms_constant_patterns() |
||
46 | } |
||
47 | } |
||
48 |
Adding explicit visibility (
private
,protected
, orpublic
) is generally recommend to communicate to other developers how, and from where this method is intended to be used.