| Conditions | 1 |
| Paths | 1 |
| Total Lines | 21 |
| Code Lines | 19 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 17 | public function testJsonSerialize(): void |
||
| 18 | { |
||
| 19 | $rb = new ResponseBody(); |
||
| 20 | $this->assertEquals(new ArrayObject(), $rb->jsonSerialize()); |
||
| 21 | $rb->shouldEndSession = true; |
||
| 22 | $this->assertEquals(new ArrayObject(['shouldEndSession' => true]), $rb->jsonSerialize()); |
||
| 23 | $card = new Card(); |
||
| 24 | $rb->card = $card; |
||
| 25 | $os = new OutputSpeech(); |
||
| 26 | $rb->outputSpeech = $os; |
||
| 27 | $directive = new RenderTemplateDirective(); |
||
| 28 | $rb->addDirective($directive); |
||
| 29 | $reprompt = new Reprompt($rb->outputSpeech); |
||
| 30 | $rb->reprompt = $reprompt; |
||
| 31 | $this->assertEquals(new ArrayObject([ |
||
| 32 | 'outputSpeech' => $os, |
||
| 33 | 'card' => $card, |
||
| 34 | 'reprompt' => $reprompt, |
||
| 35 | 'shouldEndSession' => true, |
||
| 36 | 'directives' => [$directive], |
||
| 37 | ]), $rb->jsonSerialize()); |
||
| 38 | } |
||
| 40 |