| Conditions | 1 |
| Paths | 1 |
| Total Lines | 18 |
| Code Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 14 | public function testJsonSerialize(): void |
||
| 15 | { |
||
| 16 | $slot1 = CanFulfillSlot::create(CanFulfillSlot::CAN_UNDERSTAND_YES, CanFulfillSlot::CAN_FULFILL_YES); |
||
| 17 | $slot2 = CanFulfillSlot::create(CanFulfillSlot::CAN_UNDERSTAND_MAYBE, CanFulfillSlot::CAN_FULFILL_YES); |
||
| 18 | $slot3 = CanFulfillSlot::create(CanFulfillSlot::CAN_UNDERSTAND_NO, CanFulfillSlot::CAN_FULFILL_NO); |
||
| 19 | $canFulfillIntent = CanFulfillIntentResponse::create(CanFulfillIntentResponse::CAN_FULFILL_YES, ['slot1' => $slot1, 'slot2' => $slot2]); |
||
| 20 | $canFulfillIntent->addSlot('slot3', $slot3); |
||
| 21 | $canFulfillResponseBody = CanFulfillResponseBody::create($canFulfillIntent); |
||
| 22 | $this->assertSame(json_encode([ |
||
| 23 | 'canFulfillIntent' => [ |
||
| 24 | 'canFulfill' => 'YES', |
||
| 25 | 'slots' => [ |
||
| 26 | 'slot1' => ['canUnderstand' => 'YES', 'canFulfill' => 'YES'], |
||
| 27 | 'slot2' => ['canUnderstand' => 'MAYBE', 'canFulfill' => 'YES'], |
||
| 28 | 'slot3' => ['canUnderstand' => 'NO', 'canFulfill' => 'NO'], |
||
| 29 | ], |
||
| 30 | ], |
||
| 31 | ]), json_encode($canFulfillResponseBody)); |
||
| 32 | } |
||
| 34 |