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