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
|
|
|
|