@@ 55-65 (lines=11) @@ | ||
52 | $this->assertEquals('60daysAgo', $dateRange->getStartDate()); |
|
53 | } |
|
54 | ||
55 | public function testGetStartDimensionFilters() |
|
56 | { |
|
57 | Config::inst()->update(GoogleAnalyticsReportService::class, 'starts_with', '/home'); |
|
58 | ||
59 | $filters = $this->service->getDimensionFilters(); |
|
60 | ||
61 | $this->assertTrue(is_array($filters)); |
|
62 | foreach ($filters as $filter) { |
|
63 | $this->assertInstanceOf(Google_Service_AnalyticsReporting_DimensionFilter::class, $filter); |
|
64 | } |
|
65 | } |
|
66 | ||
67 | public function testGetEndDimensionFilters() |
|
68 | { |
|
@@ 67-77 (lines=11) @@ | ||
64 | } |
|
65 | } |
|
66 | ||
67 | public function testGetEndDimensionFilters() |
|
68 | { |
|
69 | Config::inst()->update(GoogleAnalyticsReportService::class, 'ends_with', '/home'); |
|
70 | ||
71 | $filters = $this->service->getDimensionFilters(); |
|
72 | ||
73 | $this->assertTrue(is_array($filters)); |
|
74 | foreach ($filters as $filter) { |
|
75 | $this->assertInstanceOf(Google_Service_AnalyticsReporting_DimensionFilter::class, $filter); |
|
76 | } |
|
77 | } |
|
78 | ||
79 | public function testGetPageDimensionFilters() |
|
80 | { |
|
@@ 166-172 (lines=7) @@ | ||
163 | $this->assertEquals('/home/test-page/', $page->Link()); |
|
164 | } |
|
165 | ||
166 | public function testGetBlacklistedPages() |
|
167 | { |
|
168 | Config::inst()->update(GoogleAnalyticsReportService::class, 'blacklist', [ErrorPage::class]); |
|
169 | $pages = $this->service->getPages(); |
|
170 | $this->assertTrue(is_array($pages)); |
|
171 | $this->assertNotContains('page-not-found', $pages); |
|
172 | } |
|
173 | ||
174 | public function testGetWhitelistedPages() |
|
175 | { |
|
@@ 174-183 (lines=10) @@ | ||
171 | $this->assertNotContains('page-not-found', $pages); |
|
172 | } |
|
173 | ||
174 | public function testGetWhitelistedPages() |
|
175 | { |
|
176 | Config::inst()->update(GoogleAnalyticsReportService::class, 'whitelist', [Page::class]); |
|
177 | $pages = $this->service->getPages(); |
|
178 | $this->assertTrue(is_array($pages)); |
|
179 | // There seems to be some chaining in effect, causing the array to be empty |
|
180 | $this->assertEquals(20, count($pages)); |
|
181 | // Error Pages are children of Page, so they should be included |
|
182 | $this->assertContains('page-not-found', $pages); |
|
183 | } |
|
184 | ||
185 | public function testUpdateVisits() |
|
186 | { |