SiteSpec   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 1
dl 0
loc 39
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A it_is_initializable() 0 4 1
A let() 0 17 1
A it_should_be_hydrated() 0 13 1
1
<?php
2
3
namespace spec\Yproximite\Api\Model\Site;
4
5
use PhpSpec\ObjectBehavior;
6
7
use Yproximite\Api\Model\Site\Site;
8
9
class SiteSpec extends ObjectBehavior
10
{
11
    function it_is_initializable()
12
    {
13
        $this->shouldHaveType(Site::class);
14
    }
15
16
    function let()
17
    {
18
        $data = [
19
            'id'            => '3',
20
            'title'         => 'Hello world!',
21
            'host'          => 'hello-world.com',
22
            'company'       => '7',
23
            'contactEmail'  => '[email protected]',
24
            'createdAt'     => ['date' => '2011-05-19 20:46:21.000000', 'timezone_type' => 3, 'timezone' => 'UTC'],
25
            'updatedAt'     => ['date' => '2016-01-11 00:00:00.000000', 'timezone_type' => 3, 'timezone' => 'UTC'],
26
            'theme'         => '9',
27
            'billingStatus' => 'direct',
28
            'type'          => 'site',
29
        ];
30
31
        $this->beConstructedWith($data);
32
    }
33
34
    function it_should_be_hydrated()
35
    {
36
        $this->getId()->shouldReturn(3);
37
        $this->getTitle()->shouldReturn('Hello world!');
38
        $this->getHost()->shouldReturn('hello-world.com');
39
        $this->getCompanyId()->shouldReturn(7);
40
        $this->getContactEmail()->shouldReturn('[email protected]');
41
        $this->getCreatedAt()->shouldBeLike(new \DateTime('2011-05-19 20:46:21'));
42
        $this->getUpdatedAt()->shouldBeLike(new \DateTime('2016-01-11 00:00:00'));
43
        $this->getThemeId()->shouldReturn(9);
44
        $this->getBillingStatus()->shouldReturn(Site::BILLING_STATUS_DIRECT);
45
        $this->getType()->shouldReturn(Site::TYPE_SITE);
46
    }
47
}
48