@@ 224-230 (lines=7) @@ | ||
221 | /** |
|
222 | * Validate blacklisted pages don't show up |
|
223 | */ |
|
224 | public function testGetBlacklistedPages() |
|
225 | { |
|
226 | Config::inst()->update(GoogleAnalyticsReportService::class, 'blacklist', [ErrorPage::class]); |
|
227 | $pages = $this->service->getPages(); |
|
228 | $this->assertTrue(is_array($pages)); |
|
229 | $this->assertNotContains('page-not-found', $pages); |
|
230 | } |
|
231 | ||
232 | /** |
|
233 | * Make sure we only get whitelisted pages |
|
@@ 235-244 (lines=10) @@ | ||
232 | /** |
|
233 | * Make sure we only get whitelisted pages |
|
234 | */ |
|
235 | public function testGetWhitelistedPages() |
|
236 | { |
|
237 | Config::inst()->update(GoogleAnalyticsReportService::class, 'whitelist', [Page::class]); |
|
238 | $pages = $this->service->getPages(); |
|
239 | $this->assertTrue(is_array($pages)); |
|
240 | // There seems to be some chaining in effect, causing the array to be empty |
|
241 | $this->assertEquals(20, count($pages)); |
|
242 | // Error Pages are children of Page, so they should be included |
|
243 | $this->assertContains('page-not-found', $pages); |
|
244 | } |
|
245 | } |
|
246 |