Completed
Push — master ( 64f4aa...2c8981 )
by Kamil
23:00
created

AdjustmentsRemoverSpec   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A it_is_initializable() 0 4 1
A it_implements_adjustments_remover_interface() 0 4 1
A it_removes_adjustments_from_order_recursively() 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\Remover;
13
14
use PhpSpec\ObjectBehavior;
15
use Sylius\Component\Core\Model\AdjustmentInterface;
16
use Sylius\Component\Core\Model\OrderInterface;
17
use Sylius\Component\Core\Model\OrderItemUnitInterface;
18
use Sylius\Component\Core\Remover\AdjustmentsRemover;
19
use Sylius\Component\Core\Remover\AdjustmentsRemoverInterface;
20
21
/**
22
 * @mixin AdjustmentsRemover
23
 *
24
 * @author Mateusz Zalewski <[email protected]>
25
 */
26
class AdjustmentsRemoverSpec extends ObjectBehavior
27
{
28
    function it_is_initializable()
29
    {
30
        $this->shouldHaveType('Sylius\Component\Core\Remover\AdjustmentsRemover');
31
    }
32
33
    function it_implements_adjustments_remover_interface()
34
    {
35
        $this->shouldImplement(AdjustmentsRemoverInterface::class);
36
    }
37
38
    function it_removes_adjustments_from_order_recursively(OrderInterface $order)
39
    {
40
        $order->removeAdjustmentsRecursively(AdjustmentInterface::ORDER_PROMOTION_ADJUSTMENT)->shouldBeCalled();
41
        $order->removeAdjustmentsRecursively(AdjustmentInterface::ORDER_ITEM_PROMOTION_ADJUSTMENT)->shouldBeCalled();
42
        $order->removeAdjustmentsRecursively(AdjustmentInterface::TAX_ADJUSTMENT)->shouldBeCalled();
43
44
        $this->removeFrom($order);
45
    }
46
}
47