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

SitePostMessageSpec::it_should_build()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 32

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 32
rs 9.408
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace spec\Yproximite\Api\Message\Site;
4
5
use PhpSpec\ObjectBehavior;
6
7
use Yproximite\Api\Model\Site\Site;
8
use Yproximite\Api\Message\Site\SitePostMessage;
9
10
class SitePostMessageSpec extends ObjectBehavior
11
{
12
    function it_is_initializable()
13
    {
14
        $this->shouldHaveType(SitePostMessage::class);
15
    }
16
17
    function it_should_build()
18
    {
19
        $this->setTitle('Hello world!');
20
        $this->setDataParentId(5);
21
        $this->setThemeId(1);
22
        $this->setContactEmail('[email protected]');
23
        $this->setHost('hello-world.com');
24
        $this->setDefaultLocale('en');
25
        $this->setCompanyId(1);
26
        $this->setSendRegistrationEmail(true);
27
        $this->setZohoManager('Manager');
28
        $this->setZohoStatus('Active');
29
        $this->setBillingStatus(Site::BILLING_STATUS_DIRECT);
30
        $this->setImportRef('12345af');
31
32
        $data = [
33
            'title'                 => 'Hello world!',
34
            'dataParent'            => 5,
35
            'theme'                 => 1,
36
            'contactEmail'          => '[email protected]',
37
            'host'                  => 'hello-world.com',
38
            'defaultLocale'         => 'en',
39
            'company'               => 1,
40
            'sendRegistrationEmail' => true,
41
            'zohoManager'           => 'Manager',
42
            'zohoStatus'            => 'Active',
43
            'billingStatus'         => 'direct',
44
            'importRef'             => '12345af',
45
        ];
46
47
        $this->build()->shouldReturn($data);
48
    }
49
}
50