Completed
Pull Request — master (#2)
by Hannes
08:18
created

ParserExceptionSpec   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 5
lcom 0
cbo 0
dl 0
loc 30
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types = 1);
4
5
namespace spec\byrokrat\autogiro\Exception;
6
7
use byrokrat\autogiro\Exception\ParserException;
8
use PhpSpec\ObjectBehavior;
9
use Prophecy\Argument;
10
11
class ParserExceptionSpec extends ObjectBehavior
12
{
13
    const ERRORS = ['foo', 'bar'];
14
15
    function let()
16
    {
17
        $this->beConstructedWith(self::ERRORS);
18
    }
19
20
    function it_is_initializable()
21
    {
22
        $this->shouldHaveType(ParserException::CLASS);
23
    }
24
25
    function it_is_throwable()
26
    {
27
        $this->shouldHaveType(\Throwable::CLASS);
28
    }
29
30
    function it_contains_error_messages()
31
    {
32
        $this->getErrors()->shouldEqual(self::ERRORS);
33
    }
34
35
    function it_contains_an_exception_message()
36
    {
37
        $this->__tostring()->shouldMatch('/foo/');
38
        $this->__tostring()->shouldMatch('/bar/');
39
    }
40
}
41