| @@ 120-134 (lines=15) @@ | ||
| 117 | $this->assertEquals($testData['category'], $data['category']); |
|
| 118 | } |
|
| 119 | ||
| 120 | public function testFindPostByPathInactive() |
|
| 121 | { |
|
| 122 | $testData = [ |
|
| 123 | 'id' => rand(1, 100), |
|
| 124 | 'path' => 'test-path', |
|
| 125 | 'display' => 0 |
|
| 126 | ]; |
|
| 127 | ||
| 128 | $this->insertPostData($testData); |
|
| 129 | ||
| 130 | $repository = new MysqlPostRepository(self::$connection); |
|
| 131 | $data = $repository->findPostByPath($testData['path']); |
|
| 132 | ||
| 133 | $this->assertFalse($data); |
|
| 134 | } |
|
| 135 | ||
| 136 | public function testFindPostByPathFailure() |
|
| 137 | { |
|
| @@ 86-99 (lines=14) @@ | ||
| 83 | $this->assertArraySubset($testData, $data); |
|
| 84 | } |
|
| 85 | ||
| 86 | public function testGetActivityByIdFailure() |
|
| 87 | { |
|
| 88 | $testData = [ |
|
| 89 | 'id' => rand(1, 100), |
|
| 90 | 'message' => 'test data', |
|
| 91 | ]; |
|
| 92 | ||
| 93 | $this->insertData($testData); |
|
| 94 | ||
| 95 | $repository = new MysqlActivityRepository(self::$connection); |
|
| 96 | $data = $repository->getActivityById($testData['id'] + 1); |
|
| 97 | ||
| 98 | $this->assertFalse($data); |
|
| 99 | } |
|
| 100 | ||
| 101 | public function testGetActivities() |
|
| 102 | { |
|