Completed
Push — pull-request/7609 ( 4ccf63...393b85 )
by Kamil
146:59 queued 125:08
created

ChannelPricingSpec   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 5
lcom 0
cbo 1
dl 0
loc 30
rs 10
c 0
b 0
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A it_is_initializable() 0 4 1
A it_implements_channel_pricing_interface() 0 4 1
A its_product_variant_is_mutable() 0 5 1
A its_price_is_mutable() 0 5 1
A its_channel_code_is_mutable() 0 5 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\Model;
13
14
use PhpSpec\ObjectBehavior;
15
use Sylius\Component\Core\Model\ChannelInterface;
16
use Sylius\Component\Core\Model\ChannelPricing;
17
use Sylius\Component\Core\Model\ChannelPricingInterface;
18
use Sylius\Component\Core\Model\ProductVariantInterface;
19
20
/**
21
 * @author Mateusz Zalewski <[email protected]>
22
 */
23
final class ChannelPricingSpec extends ObjectBehavior
24
{
25
    function it_is_initializable()
26
    {
27
        $this->shouldHaveType(ChannelPricing::class);
28
    }
29
30
    function it_implements_channel_pricing_interface()
31
    {
32
        $this->shouldImplement(ChannelPricingInterface::class);
33
    }
34
35
    function its_channel_code_is_mutable()
36
    {
37
        $this->setChannelCode('WEB');
38
        $this->getChannelCode()->shouldReturn('WEB');
39
    }
40
41
    function its_product_variant_is_mutable(ProductVariantInterface $productVariant)
42
    {
43
        $this->setProductVariant($productVariant);
44
        $this->getProductVariant()->shouldReturn($productVariant);
45
    }
46
47
    function its_price_is_mutable()
48
    {
49
        $this->setPrice(1000);
50
        $this->getPrice()->shouldReturn(1000);
51
    }
52
}
53