Completed
Push — master ( b70f30...259e2d )
by Kamil
32:06
created

it_is_sm_exception()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 1 Features 0
Metric Value
c 2
b 1
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
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\Component\Core\Exception;
13
14
use PhpSpec\ObjectBehavior;
15
use SM\SMException;
16
use SM\StateMachine\StateMachineInterface;
17
18
/**
19
 * @author Mateusz Zalewski <[email protected]>
20
 */
21
class InvalidTransitionExceptionSpec extends ObjectBehavior
22
{
23
    function let(StateMachineInterface $stateMachine)
24
    {
25
        $stateMachine->getGraph()->willReturn('checkout_state_machine');
26
        $stateMachine->getPossibleTransitions()->willReturn(['start', 'abandon']);
27
        
28
        $this->beConstructedWith('start_checkout', $stateMachine);
29
    }
30
31
    function it_is_initializable()
32
    {
33
        $this->shouldHaveType('Sylius\Component\Core\Exception\InvalidTransitionException');
34
    }
35
36
    function it_is_sm_exception()
37
    {
38
        $this->shouldHaveType(SMException::class);
39
    }
40
41
    function it_has_message()
42
    {
43
        $this
44
            ->getMessage()
45
            ->shouldReturn('Transition "start_checkout" is invalid for "checkout_state_machine" state machine. Possible transitions are: start and abandon.')
46
        ;
47
    }
48
}
49