@@ 183-189 (lines=7) @@ | ||
180 | /** |
|
181 | * Validate blacklisted pages don't show up |
|
182 | */ |
|
183 | public function testGetBlacklistedPages() |
|
184 | { |
|
185 | Config::inst()->update(GoogleAnalyticsReportService::class, 'blacklist', [ErrorPage::class]); |
|
186 | $pages = $this->service->getPages(); |
|
187 | $this->assertTrue(is_array($pages)); |
|
188 | $this->assertNotContains('page-not-found', $pages); |
|
189 | } |
|
190 | ||
191 | /** |
|
192 | * Make sure we only get whitelisted pages |
|
@@ 194-203 (lines=10) @@ | ||
191 | /** |
|
192 | * Make sure we only get whitelisted pages |
|
193 | */ |
|
194 | public function testGetWhitelistedPages() |
|
195 | { |
|
196 | Config::inst()->update(GoogleAnalyticsReportService::class, 'whitelist', [Page::class]); |
|
197 | $pages = $this->service->getPages(); |
|
198 | $this->assertTrue(is_array($pages)); |
|
199 | // There seems to be some chaining in effect, causing the array to be empty |
|
200 | $this->assertEquals(20, count($pages)); |
|
201 | // Error Pages are children of Page, so they should be included |
|
202 | $this->assertContains('page-not-found', $pages); |
|
203 | } |
|
204 | } |
|
205 |