| @@ 197-212 (lines=16) @@ | ||
| 194 | $this->assertEquals($expected, $result); |
|
| 195 | } |
|
| 196 | ||
| 197 | public function testMarkRelatedTo() |
|
| 198 | { |
|
| 199 | $this->Reports->id = 2; |
|
| 200 | $incidents = $this->Reports->getIncidents(); |
|
| 201 | $this->assertEquals(1, $incidents->count()); |
|
| 202 | ||
| 203 | $this->post( |
|
| 204 | '/reports/mark_related_to/2', |
|
| 205 | ['related_to' => 4] |
|
| 206 | ); |
|
| 207 | ||
| 208 | $this->Reports->id = 2; |
|
| 209 | $incidents = $this->Reports->getIncidents(); |
|
| 210 | $this->assertEquals(3, $incidents->count()); |
|
| 211 | ||
| 212 | $this->_testUnmarkRelatedTo(); |
|
| 213 | } |
|
| 214 | ||
| 215 | ||
| @@ 224-234 (lines=11) @@ | ||
| 221 | * So, call at the end of testMarkRelatedTo() |
|
| 222 | * @return void |
|
| 223 | */ |
|
| 224 | private function _testUnmarkRelatedTo() |
|
| 225 | { |
|
| 226 | $this->Reports->id = 2; |
|
| 227 | $incidents = $this->Reports->getIncidents(); |
|
| 228 | $this->assertEquals(3, $incidents->count()); |
|
| 229 | ||
| 230 | $this->post('/reports/unmark_related_to/2'); |
|
| 231 | ||
| 232 | $this->Reports->id = 2; |
|
| 233 | $incidents = $this->Reports->getIncidents(); |
|
| 234 | $this->assertEquals(1, $incidents->count()); |
|
| 235 | } |
|
| 236 | ||
| 237 | /** |
|