Code Duplication    Length = 22-22 lines in 2 locations

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

@@ 564-585 (lines=22) @@
561
     *
562
     * @see \eZ\Publish\Core\Repository\URLService::loadById
563
     */
564
    public function testLoadById()
565
    {
566
        $repository = $this->getRepository();
567
568
        $id = $this->generateId('url', 23);
569
570
        /* BEGIN: Use Case */
571
        $urlService = $repository->getURLService();
572
573
        $url = $urlService->loadById($id);
574
        /* END: Use Case */
575
576
        $this->assertInstanceOf(URL::class, $url);
577
        $this->assertPropertiesCorrect([
578
            'id' => 23,
579
            'url' => '/content/view/sitemap/2',
580
            'isValid' => true,
581
            'lastChecked' => null,
582
            'created' => new DateTime('@1343140541'),
583
            'modified' => new DateTime('@1343140541'),
584
        ], $url);
585
    }
586
587
    /**
588
     * Test for URLService::loadById() method.
@@ 612-633 (lines=22) @@
609
     *
610
     * @see \eZ\Publish\Core\Repository\URLService::loadByUrl
611
     */
612
    public function testLoadByUrl()
613
    {
614
        $repository = $this->getRepository();
615
616
        $urlAddr = '/content/view/sitemap/2';
617
        /* BEGIN: Use Case */
618
        $urlService = $repository->getURLService();
619
620
        $url = $urlService->loadByUrl($urlAddr);
621
622
        /* END: Use Case */
623
624
        $this->assertInstanceOf(URL::class, $url);
625
        $this->assertPropertiesCorrect([
626
            'id' => 23,
627
            'url' => '/content/view/sitemap/2',
628
            'isValid' => true,
629
            'lastChecked' => null,
630
            'created' => new DateTime('@1343140541'),
631
            'modified' => new DateTime('@1343140541'),
632
        ], $url);
633
    }
634
635
    /**
636
     * Test for URLService::loadByUrl() method.