Completed
Push — 1.0-travis-not-deprecated ( 17c200 )
by Kamil
43:57 queued 15s
created

ResolveNextRouteSpec   A

Complexity

Total Complexity 7

Size/Duplication

Total Lines 41
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 7
lcom 0
cbo 1
dl 0
loc 41
rs 10
c 0
b 0
f 0

7 Methods

Rating   Name   Duplication   Size   Complexity  
A let() 0 4 1
A it_is_initializable() 0 4 1
A it_is_resolve_next_route_request() 0 4 1
A it_has_next_route_name() 0 6 1
A it_has_next_route_parameters() 0 6 1
A it_does_not_have_route_name_by_default() 0 4 1
A it_does_not_have_route_parameters_by_default() 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
declare(strict_types=1);
13
14
namespace spec\Sylius\Bundle\PayumBundle\Request;
15
16
use Payum\Core\Security\TokenInterface;
17
use PhpSpec\ObjectBehavior;
18
use Sylius\Bundle\PayumBundle\Request\ResolveNextRoute;
19
use Sylius\Bundle\PayumBundle\Request\ResolveNextRouteInterface;
20
21
final class ResolveNextRouteSpec extends ObjectBehavior
22
{
23
    function let(TokenInterface $token): void
24
    {
25
        $this->beConstructedWith($token);
26
    }
27
28
    function it_is_initializable(): void
29
    {
30
        $this->shouldHaveType(ResolveNextRoute::class);
31
    }
32
33
    function it_is_resolve_next_route_request(): void
34
    {
35
        $this->shouldImplement(ResolveNextRouteInterface::class);
36
    }
37
38
    function it_has_next_route_name(): void
39
    {
40
        $this->setRouteName('route_name');
41
42
        $this->getRouteName()->shouldReturn('route_name');
43
    }
44
45
    function it_has_next_route_parameters(): void
46
    {
47
        $this->setRouteParameters(['id' => 1]);
48
49
        $this->getRouteParameters()->shouldReturn(['id' => 1]);
50
    }
51
52
    function it_does_not_have_route_name_by_default(): void
53
    {
54
        $this->getRouteName()->shouldReturn(null);
55
    }
56
57
    function it_does_not_have_route_parameters_by_default(): void
58
    {
59
        $this->getRouteParameters()->shouldReturn([]);
60
    }
61
}
62