1 | <?php |
||
9 | class FirebaseTest extends \PHPUnit_Framework_TestCase |
||
10 | { |
||
11 | protected $firebase; |
||
12 | protected $todoMilk = array( |
||
13 | 'name' => 'Pick the milk', |
||
14 | 'priority' => 1 |
||
15 | ); |
||
16 | |||
17 | protected $todoBeer = array( |
||
18 | 'name' => 'Pick the beer', |
||
19 | 'priority' => 2 |
||
20 | ); |
||
21 | |||
22 | protected $todoLEGO = array( |
||
23 | 'name' => 'Pick the LEGO', |
||
24 | 'priority' => 3 |
||
25 | ); |
||
26 | |||
27 | // --- set up your own database here |
||
28 | const DEFAULT_URL = 'https://kidsplace.firebaseio.com/'; |
||
29 | const DEFAULT_TOKEN = 'MqL0c8tKCtheLSYcygYNtGhU8Z2hULOFs9OKPdEp'; |
||
30 | const DEFAULT_TODO_PATH = '/sample/todo'; |
||
31 | const DELETE_PATH = '/sample'; |
||
32 | const DEFAULT_SET_RESPONSE = '{"name":"Pick the milk","priority":1}'; |
||
33 | const DEFAULT_UPDATE_RESPONSE = '{"name":"Pick the beer","priority":2}'; |
||
34 | const DEFAULT_PUSH_RESPONSE = '{"name":"Pick the LEGO","priority":3}'; |
||
35 | const DEFAULT_DELETE_RESPONSE = 'null'; |
||
36 | const DEFAULT_URI_ERROR = 'You must provide a baseURI variable.'; |
||
37 | |||
38 | public function setUp() |
||
42 | |||
43 | public function testNoBaseURI() |
||
54 | |||
55 | public function testSet() |
||
60 | |||
61 | public function testGetAfterSet() |
||
66 | |||
67 | public function testUpdate() |
||
72 | |||
73 | public function testGetAfterUpdate() |
||
78 | |||
79 | public function testPush() |
||
85 | |||
86 | /** |
||
87 | * @depends testPush |
||
88 | */ |
||
89 | public function testGetAfterPush($responseName) |
||
94 | |||
95 | public function testDelete() |
||
100 | |||
101 | public function testGetAfterDELETE() |
||
106 | |||
107 | private function parsePushResponse($response) |
||
112 | } |
||
113 |