Passed
Push — master ( 82dae2...f5a40a )
by
unknown
04:01
created

VendorTranslationSpec   A

Complexity

Total Complexity 8

Size/Duplication

Total Lines 41
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 10
dl 0
loc 41
rs 10
c 0
b 0
f 0
wmc 8

8 Methods

Rating   Name   Duplication   Size   Complexity  
A it_extends_abstract_translation() 0 3 1
A it_has_no_description_by_default() 0 3 1
A it_is_initializable() 0 3 1
A it_implements_translation_interface() 0 3 1
A it_has_no_id_by_default() 0 3 1
A it_allows_access_via_properties() 0 4 1
A it_implements_vendor_translation_interface() 0 3 1
A it_implements_resource_interface() 0 3 1
1
<?php
2
3
namespace spec\Odiseo\SyliusVendorPlugin\Model;
4
5
use Odiseo\SyliusVendorPlugin\Model\VendorTranslation;
6
use Odiseo\SyliusVendorPlugin\Model\VendorTranslationInterface;
7
use PhpSpec\ObjectBehavior;
8
use Sylius\Component\Resource\Model\AbstractTranslation;
9
use Sylius\Component\Resource\Model\ResourceInterface;
10
use Sylius\Component\Resource\Model\TranslationInterface;
11
12
class VendorTranslationSpec extends ObjectBehavior
13
{
14
    function it_is_initializable()
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(VendorTranslation::class);
17
    }
18
19
    function it_extends_abstract_translation()
20
    {
21
        $this->shouldHaveType(AbstractTranslation::class);
22
    }
23
24
    function it_implements_translation_interface(): void
25
    {
26
        $this->shouldImplement(TranslationInterface::class);
27
    }
28
29
    function it_implements_vendor_translation_interface(): void
30
    {
31
        $this->shouldImplement(VendorTranslationInterface::class);
32
    }
33
34
    function it_implements_resource_interface(): void
35
    {
36
        $this->shouldImplement(ResourceInterface::class);
37
    }
38
39
    function it_has_no_id_by_default(): void
40
    {
41
        $this->getId()->shouldReturn(null);
0 ignored issues
show
Bug introduced by
The method getId() does not exist on spec\Odiseo\SyliusVendor...l\VendorTranslationSpec. 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
               getId()->shouldReturn(null);
Loading history...
42
    }
43
44
    function it_has_no_description_by_default(): void
45
    {
46
        $this->getDescription()->shouldReturn(null);
0 ignored issues
show
Bug introduced by
The method getDescription() does not exist on spec\Odiseo\SyliusVendor...l\VendorTranslationSpec. 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

46
        $this->/** @scrutinizer ignore-call */ 
47
               getDescription()->shouldReturn(null);
Loading history...
47
    }
48
49
    function it_allows_access_via_properties(): void
50
    {
51
        $this->setDescription('Vendor description');
0 ignored issues
show
Bug introduced by
The method setDescription() does not exist on spec\Odiseo\SyliusVendor...l\VendorTranslationSpec. 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

51
        $this->/** @scrutinizer ignore-call */ 
52
               setDescription('Vendor description');
Loading history...
52
        $this->getDescription()->shouldReturn('Vendor description');;
53
    }
54
}
55