|
@@ 195-201 (lines=7) @@
|
| 192 |
|
/** |
| 193 |
|
* Validate blacklisted pages don't show up |
| 194 |
|
*/ |
| 195 |
|
public function testGetBlacklistedPages() |
| 196 |
|
{ |
| 197 |
|
Config::inst()->update(GoogleAnalyticsReportService::class, 'blacklist', [ErrorPage::class]); |
| 198 |
|
$pages = $this->service->getPages(); |
| 199 |
|
$this->assertTrue(is_array($pages)); |
| 200 |
|
$this->assertNotContains('page-not-found', $pages); |
| 201 |
|
} |
| 202 |
|
|
| 203 |
|
/** |
| 204 |
|
* Make sure we only get whitelisted pages |
|
@@ 206-215 (lines=10) @@
|
| 203 |
|
/** |
| 204 |
|
* Make sure we only get whitelisted pages |
| 205 |
|
*/ |
| 206 |
|
public function testGetWhitelistedPages() |
| 207 |
|
{ |
| 208 |
|
Config::inst()->update(GoogleAnalyticsReportService::class, 'whitelist', [Page::class]); |
| 209 |
|
$pages = $this->service->getPages(); |
| 210 |
|
$this->assertTrue(is_array($pages)); |
| 211 |
|
// There seems to be some chaining in effect, causing the array to be empty |
| 212 |
|
$this->assertEquals(20, count($pages)); |
| 213 |
|
// Error Pages are children of Page, so they should be included |
| 214 |
|
$this->assertContains('page-not-found', $pages); |
| 215 |
|
} |
| 216 |
|
} |
| 217 |
|
|