Code Duplication    Length = 29-30 lines in 3 locations

eZ/Publish/API/Repository/Tests/URLServiceTest.php 3 locations

@@ 169-198 (lines=30) @@
166
     *
167
     * @see \eZ\Publish\Core\Repository\URLService::findUrls()
168
     */
169
    public function testFindUrls()
170
    {
171
        $expectedUrls = [
172
            'http://www.apache.org/',
173
            'http://calendar.google.com/calendar/render',
174
            'http://www.dropbox.com/',
175
            '/content/view/sitemap/2',
176
            'http://support.google.com/chrome/answer/95647?hl=es',
177
            'http://www.nazwa.pl/',
178
            'http://www.facebook.com/sharer.php',
179
            'http://www.wikipedia.org/',
180
            'http://www.google.de/',
181
            'http://www.google.com/',
182
            'http://www.nginx.com/',
183
            '/content/view/tagcloud/2',
184
            'http://www.youtube.com/',
185
            'http://vimeo.com/',
186
            'http://windows.microsoft.com/en-US/internet-explorer/products/ie/home',
187
            'http://twitter.com/',
188
            'http://www.google.com/analytics/',
189
            'http://www.facebook.com/',
190
            'http://www.discuz.net/forum.php',
191
            'http://instagram.com/',
192
        ];
193
194
        $query = new URLQuery();
195
        $query->filter = new Criterion\MatchAll();
196
197
        $this->doTestFindUrls($query, $expectedUrls);
198
    }
199
200
    /**
201
     * Test for URLService::findUrls() method.
@@ 242-270 (lines=29) @@
239
     * @see \eZ\Publish\Core\Repository\URLService::findUrls()
240
     * @depends eZ\Publish\API\Repository\Tests\URLServiceTest::testFindUrls
241
     */
242
    public function testFindUrlsUsingValidityCriterionValid()
243
    {
244
        $expectedUrls = [
245
            'http://www.google.com/',
246
            '/content/view/sitemap/2',
247
            'http://support.google.com/chrome/answer/95647?hl=es',
248
            'http://www.google.de/',
249
            'http://www.nginx.com/',
250
            'http://www.google.com/analytics/',
251
            'http://www.discuz.net/forum.php',
252
            'http://www.wikipedia.org/',
253
            'http://www.facebook.com/sharer.php',
254
            'http://twitter.com/',
255
            'http://www.nazwa.pl/',
256
            'http://instagram.com/',
257
            'http://www.apache.org/',
258
            'http://www.dropbox.com/',
259
            'http://www.facebook.com/',
260
            'http://www.youtube.com/',
261
            'http://calendar.google.com/calendar/render',
262
            'http://vimeo.com/',
263
            'http://windows.microsoft.com/en-US/internet-explorer/products/ie/home',
264
        ];
265
266
        $query = new URLQuery();
267
        $query->filter = new Criterion\Validity(true);
268
269
        $this->doTestFindUrls($query, $expectedUrls);
270
    }
271
272
    /**
273
     * Test for URLService::findUrls() method.
@@ 409-437 (lines=29) @@
406
     * @see \eZ\Publish\Core\Repository\URLService::findUrls()
407
     * @depends eZ\Publish\API\Repository\Tests\URLServiceTest::testFindUrls
408
     */
409
    public function testFindUrlsUsingVisibleOnlyCriterion()
410
    {
411
        $expectedUrls = [
412
            'http://vimeo.com/',
413
            'http://calendar.google.com/calendar/render',
414
            'http://www.facebook.com/',
415
            'http://www.google.com/',
416
            'http://www.google.com/analytics/',
417
            'http://www.facebook.com/sharer.php',
418
            'http://www.apache.org/',
419
            'http://www.nginx.com/',
420
            'http://www.wikipedia.org/',
421
            'http://www.youtube.com/',
422
            'http://windows.microsoft.com/en-US/internet-explorer/products/ie/home',
423
            'http://www.google.de/',
424
            'http://instagram.com/',
425
            'http://www.nazwa.pl/',
426
            '/content/view/tagcloud/2',
427
            'http://www.discuz.net/forum.php',
428
            'http://support.google.com/chrome/answer/95647?hl=es',
429
            'http://twitter.com/',
430
            '/content/view/sitemap/2',
431
        ];
432
433
        $query = new URLQuery();
434
        $query->filter = new Criterion\VisibleOnly();
435
436
        $this->doTestFindUrls($query, $expectedUrls);
437
    }
438
439
    /**
440
     * Test for URLService::findUrls() method.