Completed
Push — master ( 155c16...880d18 )
by Kamil
26:05
created

OptionTranslationSpec   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

5 Methods

Rating   Name   Duplication   Size   Complexity  
A it_is_initializable() 0 4 1
A it_implement_Sylius_option_interface() 0 4 1
A it_should_not_have_id_by_default() 0 4 1
A it_should_not_have_name_by_default() 0 4 1
A its_name_should_be_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\Variation\Model;
13
14
use PhpSpec\ObjectBehavior;
15
use Sylius\Component\Variation\Model\OptionTranslationInterface;
16
17
/**
18
 * @author Gonzalo Vilaseca <[email protected]>
19
 */
20
class OptionTranslationSpec extends ObjectBehavior
21
{
22
    function it_is_initializable()
23
    {
24
        $this->shouldHaveType('Sylius\Component\Variation\Model\OptionTranslation');
25
    }
26
27
    function it_implement_Sylius_option_interface()
28
    {
29
        $this->shouldImplement(OptionTranslationInterface::class);
30
    }
31
32
    function it_should_not_have_id_by_default()
33
    {
34
        $this->getId()->shouldReturn(null);
35
    }
36
37
    function it_should_not_have_name_by_default()
38
    {
39
        $this->getName()->shouldReturn(null);
40
    }
41
42
    function its_name_should_be_mutable()
43
    {
44
        $this->setName('Size');
45
        $this->getName()->shouldReturn('Size');
46
    }
47
}
48