Code Duplication    Length = 13-13 lines in 3 locations

tests/GoogleAnalyticsReportServiceTest.php 3 locations

@@ 124-136 (lines=13) @@
121
        $this->assertInstanceOf(Page::class, $page);
122
    }
123
124
    public function testFindChildPage()
125
    {
126
        /** @var Page $homePage */
127
        $homePage = Page::get()->filter(['URLSegment' => 'home'])->first();
128
        /** @var Page $homePage */
129
        $child = Page::create(['Title' => 'Test Page', 'ParentID' => $homePage->ID]);
130
        $child->write();
131
        $child->doPublish();
132
        $testArray = ['', '', 'test-page'];
133
        $page = $this->service->findPage($testArray);
134
        $this->assertInstanceOf(Page::class, $page);
135
        $this->assertEquals('/home/test-page/', $page->Link());
136
    }
137
138
    public function testFindChildPageWithQuery()
139
    {
@@ 138-150 (lines=13) @@
135
        $this->assertEquals('/home/test-page/', $page->Link());
136
    }
137
138
    public function testFindChildPageWithQuery()
139
    {
140
        /** @var Page $homePage */
141
        $homePage = Page::get()->filter(['URLSegment' => 'home'])->first();
142
        /** @var Page $homePage */
143
        $child = Page::create(['Title' => 'Test Page', 'ParentID' => $homePage->ID]);
144
        $child->write();
145
        $child->doPublish();
146
        $testArray = ['', '', 'test-page', '?stage=Stage'];
147
        $page = $this->service->findPage($testArray);
148
        $this->assertInstanceOf(Page::class, $page);
149
        $this->assertEquals('/home/test-page/', $page->Link());
150
    }
151
152
    public function testFindPageWithEmptyLast()
153
    {
@@ 152-164 (lines=13) @@
149
        $this->assertEquals('/home/test-page/', $page->Link());
150
    }
151
152
    public function testFindPageWithEmptyLast()
153
    {
154
        /** @var Page $homePage */
155
        $homePage = Page::get()->filter(['URLSegment' => 'home'])->first();
156
        /** @var Page $homePage */
157
        $child = Page::create(['Title' => 'Test Page', 'ParentID' => $homePage->ID]);
158
        $child->write();
159
        $child->doPublish();
160
        $testArray = ['', '', 'test-page', ''];
161
        $page = $this->service->findPage($testArray);
162
        $this->assertInstanceOf(Page::class, $page);
163
        $this->assertEquals('/home/test-page/', $page->Link());
164
    }
165
166
    public function testGetBlacklistedPages()
167
    {