|
@@ 181-194 (lines=14) @@
|
| 178 |
|
return ((new DateTime($rowA['date'])) < (new DateTime($rowB['date']))); |
| 179 |
|
}); |
| 180 |
|
|
| 181 |
|
foreach ($testData as $key => $testRow) { |
| 182 |
|
$this->assertArrayHasKey('id', $data[$key]); |
| 183 |
|
$this->assertEquals($testRow['id'], $data[$key]['id']); |
| 184 |
|
$this->assertArrayHasKey('title', $data[$key]); |
| 185 |
|
$this->assertEquals($testRow['title'], $data[$key]['title']); |
| 186 |
|
$this->assertArrayHasKey('path', $data[$key]); |
| 187 |
|
$this->assertEquals($testRow['path'], $data[$key]['path']); |
| 188 |
|
$this->assertArrayHasKey('date', $data[$key]); |
| 189 |
|
$this->assertEquals($testRow['date'], $data[$key]['date']); |
| 190 |
|
$this->assertArrayHasKey('body', $data[$key]); |
| 191 |
|
$this->assertEquals($testRow['body'], $data[$key]['body']); |
| 192 |
|
$this->assertArrayHasKey('category', $data[$key]); |
| 193 |
|
$this->assertEquals($testRow['category'], $data[$key]['category']); |
| 194 |
|
} |
| 195 |
|
} |
| 196 |
|
|
| 197 |
|
public function testGetActivePostsInactive() |
|
@@ 419-432 (lines=14) @@
|
| 416 |
|
$this->assertNotFalse($data); |
| 417 |
|
$this->assertInternalType('array', $data); |
| 418 |
|
$this->assertCount(count($testPostData), $data); |
| 419 |
|
foreach ($testPostData as $key => $testPostRow) { |
| 420 |
|
$this->assertArrayHasKey('id', $data[$key]); |
| 421 |
|
$this->assertEquals($testPostRow['id'], $data[$key]['id']); |
| 422 |
|
$this->assertArrayHasKey('title', $data[$key]); |
| 423 |
|
$this->assertEquals($testPostRow['title'], $data[$key]['title']); |
| 424 |
|
$this->assertArrayHasKey('path', $data[$key]); |
| 425 |
|
$this->assertEquals($testPostRow['path'], $data[$key]['path']); |
| 426 |
|
$this->assertArrayHasKey('date', $data[$key]); |
| 427 |
|
$this->assertEquals($testPostRow['date'], $data[$key]['date']); |
| 428 |
|
$this->assertArrayHasKey('body', $data[$key]); |
| 429 |
|
$this->assertEquals($testPostRow['body'], $data[$key]['body']); |
| 430 |
|
$this->assertArrayHasKey('category', $data[$key]); |
| 431 |
|
$this->assertEquals($testPostRow['category'], $data[$key]['category']); |
| 432 |
|
} |
| 433 |
|
} |
| 434 |
|
|
| 435 |
|
public function testGetActivePostsByTagInactive() |
|
@@ 728-741 (lines=14) @@
|
| 725 |
|
$this->assertNotFalse($data); |
| 726 |
|
$this->assertInternalType('array', $data); |
| 727 |
|
$this->assertCount(count($testData), $data); |
| 728 |
|
foreach ($testData as $key => $testDataRow) { |
| 729 |
|
$this->assertArrayHasKey('id', $data[$key]); |
| 730 |
|
$this->assertEquals($testDataRow['id'], $data[$key]['id']); |
| 731 |
|
$this->assertArrayHasKey('title', $data[$key]); |
| 732 |
|
$this->assertEquals($testDataRow['title'], $data[$key]['title']); |
| 733 |
|
$this->assertArrayHasKey('path', $data[$key]); |
| 734 |
|
$this->assertEquals($testDataRow['path'], $data[$key]['path']); |
| 735 |
|
$this->assertArrayHasKey('date', $data[$key]); |
| 736 |
|
$this->assertEquals($testDataRow['date'], $data[$key]['date']); |
| 737 |
|
$this->assertArrayHasKey('body', $data[$key]); |
| 738 |
|
$this->assertEquals($testDataRow['body'], $data[$key]['body']); |
| 739 |
|
$this->assertArrayHasKey('category', $data[$key]); |
| 740 |
|
$this->assertEquals($testDataRow['category'], $data[$key]['category']); |
| 741 |
|
} |
| 742 |
|
} |
| 743 |
|
|
| 744 |
|
public function testGetActivePostsByCategoryInactive() |