NoteTest   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 3
Bugs 0 Features 0
Metric Value
wmc 1
c 3
b 0
f 0
lcom 1
cbo 2
dl 0
loc 38
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
B it_can_push_a_note() 0 33 1
1
<?php
2
3
require_once 'base/PHPushbulletTestBase.php';
4
5
class NoteTest extends PHPushbulletTestBase
6
{
7
    /** @test */
8
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