Code Duplication    Length = 21-23 lines in 3 locations

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

@@ 296-316 (lines=21) @@
293
     *
294
     * @see \eZ\Publish\API\Repository\URLAliasService::createGlobalUrlAlias()
295
     */
296
    public function testCreateGlobalUrlAlias()
297
    {
298
        $repository = $this->getRepository();
299
300
        /* BEGIN: Use Case */
301
        $urlAliasService = $repository->getURLAliasService();
302
303
        $createdUrlAlias = $urlAliasService->createGlobalUrlAlias(
304
            'module:content/search?SearchText=eZ',
305
            '/Home/My-New-Site',
306
            'eng-US'
307
        );
308
        /* END: Use Case */
309
310
        $this->assertInstanceOf(
311
            URLAlias::class,
312
            $createdUrlAlias
313
        );
314
315
        return $createdUrlAlias;
316
    }
317
318
    /**
319
     * @param \eZ\Publish\API\Repository\Values\Content\URLAlias
@@ 347-368 (lines=22) @@
344
     *
345
     * @see \eZ\Publish\API\Repository\URLAliasService::createGlobalUrlAlias($resource, $path, $languageCode, $forward)
346
     */
347
    public function testCreateGlobalUrlAliasWithForward()
348
    {
349
        $repository = $this->getRepository();
350
351
        /* BEGIN: Use Case */
352
        $urlAliasService = $repository->getURLAliasService();
353
354
        $createdUrlAlias = $urlAliasService->createGlobalUrlAlias(
355
            'module:content/search?SearchText=eZ',
356
            '/Home/My-New-Site',
357
            'eng-US',
358
            true
359
        );
360
        /* END: Use Case */
361
362
        $this->assertInstanceOf(
363
            URLAlias::class,
364
            $createdUrlAlias
365
        );
366
367
        return $createdUrlAlias;
368
    }
369
370
    /**
371
     * @param \eZ\Publish\API\Repository\Values\Content\URLAlias
@@ 399-421 (lines=23) @@
396
     *
397
     * @see \eZ\Publish\API\Repository\URLAliasService::createGlobalUrlAlias($resource, $path, $languageCode, $forwarding, $alwaysAvailable)
398
     */
399
    public function testCreateGlobalUrlAliasWithAlwaysAvailable()
400
    {
401
        $repository = $this->getRepository();
402
403
        /* BEGIN: Use Case */
404
        $urlAliasService = $repository->getURLAliasService();
405
406
        $createdUrlAlias = $urlAliasService->createGlobalUrlAlias(
407
            'module:content/search?SearchText=eZ',
408
            '/Home/My-New-Site',
409
            'eng-US',
410
            false,
411
            true
412
        );
413
        /* END: Use Case */
414
415
        $this->assertInstanceOf(
416
            URLAlias::class,
417
            $createdUrlAlias
418
        );
419
420
        return $createdUrlAlias;
421
    }
422
423
    /**
424
     * @param \eZ\Publish\API\Repository\Values\Content\URLAlias