|
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 testFindBy() |
|
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->findBy('people', 3); |
|
|
|
|
|
|
22
|
|
|
$this->assertSameLastRequestUri('/people/3/tasks.xml', $resource); |
|
23
|
|
|
} |
|
24
|
|
|
|
|
25
|
|
|
public function testFindUpcoming() |
|
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->findUpcoming(); |
|
|
|
|
|
|
30
|
|
|
$this->assertSameLastRequestUri('/tasks/upcoming.xml', $resource); |
|
31
|
|
|
} |
|
32
|
|
|
|
|
33
|
|
|
public function testFindAssigned() |
|
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->findAssigned(); |
|
|
|
|
|
|
38
|
|
|
$this->assertSameLastRequestUri('/tasks/assigned.xml', $resource); |
|
39
|
|
|
} |
|
40
|
|
|
|
|
41
|
|
|
public function testFindCompleted() |
|
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->findCompleted(); |
|
|
|
|
|
|
46
|
|
|
$this->assertSameLastRequestUri('/tasks/completed.xml', $resource); |
|
47
|
|
|
} |
|
48
|
|
|
|
|
49
|
|
|
public function testFindToday() |
|
50
|
|
|
{ |
|
51
|
|
|
$body = '<tasks type="array"><task><id>1</id></task><task><id>2</id></task></tasks>'; |
|
52
|
|
|
$resource = $this->getMockResource('tasks', $body); |
|
53
|
|
|
$resource->findToday(); |
|
|
|
|
|
|
54
|
|
|
$this->assertSameLastRequestUri('/tasks/today.xml', $resource); |
|
55
|
|
|
} |
|
56
|
|
|
} |
|
57
|
|
|
|
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.