Passed
Pull Request — master (#12)
by romain
09:45
created

ArticleTranslationSpec   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 1
dl 0
loc 27
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace spec\Yproximite\Api\Model\Article;
4
5
use PhpSpec\ObjectBehavior;
6
7
use Yproximite\Api\Model\Article\ArticleTranslation;
8
9
class ArticleTranslationSpec extends ObjectBehavior
10
{
11
    function it_is_initializable()
12
    {
13
        $this->shouldHaveType(ArticleTranslation::class);
14
    }
15
16
    function let()
17
    {
18
        $data = [
19
            'locale' => 'en',
20
            'title'  => 'English translation',
21
            'body'   => 'Big text',
22
            'slug'   => 'en-translation',
23
        ];
24
25
        $this->beConstructedWith($data);
26
    }
27
28
    function it_should_be_hydrated()
29
    {
30
        $this->getLocale()->shouldReturn('en');
31
        $this->getTitle()->shouldReturn('English translation');
32
        $this->getBody()->shouldReturn('Big text');
33
        $this->getSlug()->shouldReturn('en-translation');
34
    }
35
}
36