Conditions | 1 |
Paths | 1 |
Total Lines | 33 |
Code Lines | 20 |
Lines | 0 |
Ratio | 0 % |
Changes | 3 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
9 | public function it_can_push_a_note() |
||
10 | { |
||
11 | $devices = [ |
||
12 | 'devices' => [ |
||
13 | $this->getDevice('android'), |
||
14 | $this->getDevice('chrome') |
||
15 | ], |
||
16 | ]; |
||
17 | |||
18 | $response = $this->pushResponse([ |
||
19 | 'type' => 'note', |
||
20 | 'title' => 'Reminder', |
||
21 | 'body' => 'Do this thing', |
||
22 | ]); |
||
23 | |||
24 | $this->mock([ |
||
25 | $this->okResponse($devices), |
||
26 | $this->okResponse($response), |
||
27 | ]); |
||
28 | |||
29 | $response = $this->pushbullet->device('Chrome')->note('Reminder', 'Do this thing'); |
||
30 | |||
31 | $this->assertInternalType('array', $response); |
||
32 | $this->assertCount(1, $response); |
||
33 | |||
34 | $first = reset($response); |
||
35 | |||
36 | $this->assertSame('note', $first['type']); |
||
37 | $this->assertSame('Reminder', $first['title']); |
||
38 | $this->assertSame('Do this thing', $first['body']); |
||
39 | |||
40 | $this->assertRequestHistory(['devices', 'pushes']); |
||
41 | } |
||
42 | } |
||
43 |