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(); |
|
|
|
|
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(); |
|
|
|
|
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(); |
|
|
|
|
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(); |
|
|
|
|
46
|
|
|
$this->assertSameLastRequestUri('/tasks/today.xml', $resource); |
47
|
|
|
} |
48
|
|
|
} |
49
|
|
|
|