|
@@ 161-167 (lines=7) @@
|
| 158 |
|
/** |
| 159 |
|
* Validate blacklisted pages don't show up |
| 160 |
|
*/ |
| 161 |
|
public function testGetBlacklistedPages() |
| 162 |
|
{ |
| 163 |
|
Config::inst()->update(GoogleAnalyticsReportService::class, 'blacklist', [ErrorPage::class]); |
| 164 |
|
$pages = $this->service->getPages(); |
| 165 |
|
$this->assertTrue(is_array($pages)); |
| 166 |
|
$this->assertNotContains('page-not-found', $pages); |
| 167 |
|
} |
| 168 |
|
|
| 169 |
|
/** |
| 170 |
|
* Make sure we only get whitelisted pages |
|
@@ 172-181 (lines=10) @@
|
| 169 |
|
/** |
| 170 |
|
* Make sure we only get whitelisted pages |
| 171 |
|
*/ |
| 172 |
|
public function testGetWhitelistedPages() |
| 173 |
|
{ |
| 174 |
|
Config::inst()->update(GoogleAnalyticsReportService::class, 'whitelist', [Page::class]); |
| 175 |
|
$pages = $this->service->getPages(); |
| 176 |
|
$this->assertTrue(is_array($pages)); |
| 177 |
|
// There seems to be some chaining in effect, causing the array to be empty |
| 178 |
|
$this->assertEquals(20, count($pages)); |
| 179 |
|
// Error Pages are children of Page, so they should be included |
| 180 |
|
$this->assertContains('page-not-found', $pages); |
| 181 |
|
} |
| 182 |
|
} |
| 183 |
|
|