Code Duplication    Length = 7-10 lines in 2 locations

tests/GoogleAnalyticsReportServiceTest.php 2 locations

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