ChannelDepositSpec   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 13
dl 0
loc 32
rs 10
c 0
b 0
f 0
wmc 5

5 Methods

Rating   Name   Duplication   Size   Complexity  
A it_has_product_variant() 0 5 1
A it_is_channel_deposit() 0 3 1
A it_implements_channel_deposit_interface() 0 3 1
A it_has_price() 0 5 1
A is_has_channel_code() 0 6 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace spec\Gewebe\SyliusProductDepositPlugin\Entity;
6
7
use Gewebe\SyliusProductDepositPlugin\Entity\ChannelDeposit;
8
use Gewebe\SyliusProductDepositPlugin\Entity\ChannelDepositInterface;
9
use Gewebe\SyliusProductDepositPlugin\Entity\ProductVariantInterface;
10
use PhpSpec\ObjectBehavior;
11
12
final class ChannelDepositSpec extends ObjectBehavior
13
{
14
    function it_is_channel_deposit(): void
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
15
    {
16
        $this->shouldHaveType(ChannelDeposit::class);
17
    }
18
19
    function it_implements_channel_deposit_interface(): void
20
    {
21
        $this->shouldImplement(ChannelDepositInterface::class);
22
    }
23
24
    function it_has_price(): void
25
    {
26
        $this->getPrice()->shouldReturn(null);
0 ignored issues
show
Bug introduced by
The method getPrice() does not exist on spec\Gewebe\SyliusProduc...tity\ChannelDepositSpec. Since you implemented __call, consider adding a @method annotation. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

26
        $this->/** @scrutinizer ignore-call */ 
27
               getPrice()->shouldReturn(null);
Loading history...
27
        $this->setPrice(25);
0 ignored issues
show
Bug introduced by
The method setPrice() does not exist on spec\Gewebe\SyliusProduc...tity\ChannelDepositSpec. Since you implemented __call, consider adding a @method annotation. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

27
        $this->/** @scrutinizer ignore-call */ 
28
               setPrice(25);
Loading history...
28
        $this->getPrice()->shouldReturn(25);
29
    }
30
31
    function it_has_product_variant(ProductVariantInterface $productVariant): void
32
    {
33
        $this->getProductVariant()->shouldReturn(null);
0 ignored issues
show
Bug introduced by
The method getProductVariant() does not exist on spec\Gewebe\SyliusProduc...tity\ChannelDepositSpec. Since you implemented __call, consider adding a @method annotation. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

33
        $this->/** @scrutinizer ignore-call */ 
34
               getProductVariant()->shouldReturn(null);
Loading history...
34
        $this->setProductVariant($productVariant);
0 ignored issues
show
Bug introduced by
The method setProductVariant() does not exist on spec\Gewebe\SyliusProduc...tity\ChannelDepositSpec. Since you implemented __call, consider adding a @method annotation. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

34
        $this->/** @scrutinizer ignore-call */ 
35
               setProductVariant($productVariant);
Loading history...
35
        $this->getProductVariant()->shouldReturn($productVariant);
36
    }
37
38
    function is_has_channel_code(): void
39
    {
40
        $this->getChannelCode()->shouldReturn(null);
0 ignored issues
show
Bug introduced by
The method getChannelCode() does not exist on spec\Gewebe\SyliusProduc...tity\ChannelDepositSpec. Since you implemented __call, consider adding a @method annotation. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

40
        $this->/** @scrutinizer ignore-call */ 
41
               getChannelCode()->shouldReturn(null);
Loading history...
41
        $this->setChannelCode(null);
0 ignored issues
show
Bug introduced by
The method setChannelCode() does not exist on spec\Gewebe\SyliusProduc...tity\ChannelDepositSpec. Since you implemented __call, consider adding a @method annotation. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

41
        $this->/** @scrutinizer ignore-call */ 
42
               setChannelCode(null);
Loading history...
42
        $this->setChannelCode('de');
43
        $this->getChannelCode()->shouldReturn('de');
44
    }
45
}
46