Completed
Push — master ( b31cd6...60f5be )
by Kamil
43:45
created

OrderProcessorSpec   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 4
c 1
b 0
f 1
lcom 0
cbo 2
dl 0
loc 26
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A let() 0 4 1
A it_is_initializable() 0 4 1
A it_implements_order_processor_interface() 0 4 1
A it_runs_order_shipment_processor_to_control_order_shipments() 0 8 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\Component\Core\OrderProcessing;
13
14
use PhpSpec\ObjectBehavior;
15
use Sylius\Component\Core\Model\OrderInterface;
16
use Sylius\Component\Core\OrderProcessing\OrderProcessorInterface;
17
use Sylius\Component\Core\OrderProcessing\OrderShipmentProcessorInterface;
18
19
/**
20
 * @author Mateusz Zalewski <[email protected]>
21
 */
22
class OrderProcessorSpec extends ObjectBehavior
23
{
24
    function let(OrderShipmentProcessorInterface $orderShipmentProcessor)
25
    {
26
        $this->beConstructedWith($orderShipmentProcessor);
27
    }
28
29
    function it_is_initializable()
30
    {
31
        $this->shouldHaveType('Sylius\Component\Core\OrderProcessing\OrderProcessor');
32
    }
33
34
    function it_implements_order_processor_interface()
35
    {
36
        $this->shouldImplement(OrderProcessorInterface::class);
37
    }
38
39
    function it_runs_order_shipment_processor_to_control_order_shipments(
40
        OrderInterface $order,
41
        OrderShipmentProcessorInterface $orderShipmentProcessor
42
    ) {
43
        $orderShipmentProcessor->processOrderShipment($order)->shouldBeCalled();
44
45
        $this->process($order);
46
    }
47
}
48