Conditions | 1 |
Paths | 1 |
Total Lines | 45 |
Code Lines | 30 |
Lines | 0 |
Ratio | 0 % |
Changes | 3 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
9 | public function it_can_push_a_list() |
||
10 | { |
||
11 | $devices = [ |
||
12 | 'devices' => [ |
||
13 | $this->getDevice('android'), |
||
14 | $this->getDevice('chrome') |
||
15 | ], |
||
16 | ]; |
||
17 | |||
18 | $response = $this->pushResponse([ |
||
19 | 'type' => 'list', |
||
20 | 'title' => 'My List', |
||
21 | 'items' => [ |
||
22 | 'This', |
||
23 | 'That', |
||
24 | 'Other thing', |
||
25 | ], |
||
26 | ]); |
||
27 | |||
28 | $this->mock([ |
||
29 | $this->okResponse($devices), |
||
30 | $this->okResponse($response), |
||
31 | ]); |
||
32 | |||
33 | $response = $this->pushbullet->device('Chrome')->list('My List', [ |
||
34 | 'This', |
||
35 | 'That', |
||
36 | 'Other thing', |
||
37 | ]); |
||
38 | |||
39 | $this->assertInternalType('array', $response); |
||
40 | $this->assertCount(1, $response); |
||
41 | |||
42 | $first = reset($response); |
||
43 | |||
44 | $this->assertSame('list', $first['type']); |
||
45 | $this->assertSame('My List', $first['title']); |
||
46 | $this->assertSame([ |
||
47 | 'This', |
||
48 | 'That', |
||
49 | 'Other thing', |
||
50 | ], $first['items']); |
||
51 | |||
52 | $this->assertRequestHistory(['devices', 'pushes']); |
||
53 | } |
||
54 | } |
||
55 |