Completed
Push — master ( 52b305...ed76d4 )
by Guillermo A.
01:49
created

TasksTest   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 40
rs 10
c 0
b 0
f 0
wmc 5

5 Methods

Rating   Name   Duplication   Size   Complexity  
A testFindAll() 0 6 1
A testFindToday() 0 6 1
A testFindAssigned() 0 6 1
A testFindCompleted() 0 6 1
A testFindUpcoming() 0 6 1
1
<?php
2
3
namespace GuillermoandraeTest\Highrise\Resources;
4
5
use GuillermoandraeTest\Highrise\TestCase;
6
7
class TasksTest extends TestCase
8
{
9
    public function testFindAll()
10
    {
11
        $body = '<tasks type="array"><task><id>1</id></task><task><id>2</id></task></tasks>';
12
        $resource = $this->getMockResource('tasks', $body);
13
        $resource->findAll();
14
        $this->assertSameLastRequestUri('/tasks/all.xml', $resource);
15
    }
16
17
    public function testFindUpcoming()
18
    {
19
        $body = '<tasks type="array"><task><id>1</id></task><task><id>2</id></task></tasks>';
20
        $resource = $this->getMockResource('tasks', $body);
21
        $resource->findUpcoming();
0 ignored issues
show
Bug introduced by
The method findUpcoming() does not exist on Guillermoandrae\Highrise...urces\ResourceInterface. It seems like you code against a sub-type of Guillermoandrae\Highrise...urces\ResourceInterface such as Guillermoandrae\Highrise\Resources\Tasks. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

21
        $resource->/** @scrutinizer ignore-call */ 
22
                   findUpcoming();
Loading history...
22
        $this->assertSameLastRequestUri('/tasks/upcoming.xml', $resource);
23
    }
24
25
    public function testFindAssigned()
26
    {
27
        $body = '<tasks type="array"><task><id>1</id></task><task><id>2</id></task></tasks>';
28
        $resource = $this->getMockResource('tasks', $body);
29
        $resource->findAssigned();
0 ignored issues
show
Bug introduced by
The method findAssigned() does not exist on Guillermoandrae\Highrise...urces\ResourceInterface. It seems like you code against a sub-type of Guillermoandrae\Highrise...urces\ResourceInterface such as Guillermoandrae\Highrise\Resources\Tasks. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

29
        $resource->/** @scrutinizer ignore-call */ 
30
                   findAssigned();
Loading history...
30
        $this->assertSameLastRequestUri('/tasks/assigned.xml', $resource);
31
    }
32
33
    public function testFindCompleted()
34
    {
35
        $body = '<tasks type="array"><task><id>1</id></task><task><id>2</id></task></tasks>';
36
        $resource = $this->getMockResource('tasks', $body);
37
        $resource->findCompleted();
0 ignored issues
show
Bug introduced by
The method findCompleted() does not exist on Guillermoandrae\Highrise...urces\ResourceInterface. It seems like you code against a sub-type of Guillermoandrae\Highrise...urces\ResourceInterface such as Guillermoandrae\Highrise\Resources\Tasks. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

37
        $resource->/** @scrutinizer ignore-call */ 
38
                   findCompleted();
Loading history...
38
        $this->assertSameLastRequestUri('/tasks/completed.xml', $resource);
39
    }
40
41
    public function testFindToday()
42
    {
43
        $body = '<tasks type="array"><task><id>1</id></task><task><id>2</id></task></tasks>';
44
        $resource = $this->getMockResource('tasks', $body);
45
        $resource->findToday();
0 ignored issues
show
Bug introduced by
The method findToday() does not exist on Guillermoandrae\Highrise...urces\ResourceInterface. It seems like you code against a sub-type of Guillermoandrae\Highrise...urces\ResourceInterface such as Guillermoandrae\Highrise\Resources\Tasks. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

45
        $resource->/** @scrutinizer ignore-call */ 
46
                   findToday();
Loading history...
46
        $this->assertSameLastRequestUri('/tasks/today.xml', $resource);
47
    }
48
}
49