1 | <?php |
||
10 | class CallTrackingPatchMessageSpec extends ObjectBehavior |
||
11 | { |
||
12 | function it_is_initializable() |
||
13 | { |
||
14 | $this->shouldHaveType(CallTrackingPatchMessage::class); |
||
15 | } |
||
16 | |||
17 | function it_should_build() |
||
18 | { |
||
19 | $this->setName('Simple call'); |
||
20 | $this->setPhoneDid('+1 123 233 99 91'); |
||
21 | $this->setPhoneDestination('+1 921 339 44 77'); |
||
22 | $this->setCallerId(true); |
||
23 | |||
24 | $data = [ |
||
25 | 'callerId' => 1, |
||
26 | ]; |
||
27 | |||
28 | $this->build()->shouldReturn($data); |
||
29 | } |
||
30 | |||
31 | function it_should_create_from_call_tracking(CallTracking $callTracking) |
||
32 | { |
||
33 | $callTracking->getId()->willReturn(1); |
||
34 | $callTracking->getName()->willReturn('Simple call'); |
||
35 | $callTracking->getPhoneDid()->willReturn('+1 123 233 99 91'); |
||
36 | $callTracking->getPhoneDestination()->willReturn('+1 921 339 44 77'); |
||
37 | $callTracking->hasCallerId()->willReturn(true); |
||
38 | |||
39 | $message = new CallTrackingPatchMessage(); |
||
40 | $message->setId(1); |
||
41 | $message->setName('Simple call'); |
||
42 | $message->setPhoneDid('+1 123 233 99 91'); |
||
43 | $message->setPhoneDestination('+1 921 339 44 77'); |
||
44 | $message->setCallerId(true); |
||
45 | |||
46 | $this::createFromCallTracking($callTracking)->shouldBeLike($message); |
||
47 | } |
||
48 | } |
||
49 |