Code Duplication    Length = 21-23 lines in 3 locations

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

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