Code Duplication    Length = 22-22 lines in 2 locations

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

@@ 696-717 (lines=22) @@
693
     *
694
     * @see \eZ\Publish\Core\Repository\URLService::loadById
695
     */
696
    public function testLoadById()
697
    {
698
        $repository = $this->getRepository();
699
700
        $id = $this->generateId('url', 23);
701
702
        /* BEGIN: Use Case */
703
        $urlService = $repository->getURLService();
704
705
        $url = $urlService->loadById($id);
706
        /* END: Use Case */
707
708
        $this->assertInstanceOf(URL::class, $url);
709
        $this->assertPropertiesCorrect([
710
            'id' => 23,
711
            'url' => '/content/view/sitemap/2',
712
            'isValid' => true,
713
            'lastChecked' => null,
714
            'created' => new DateTime('@1343140541'),
715
            'modified' => new DateTime('@1343140541'),
716
        ], $url);
717
    }
718
719
    /**
720
     * Test for URLService::loadById() method.
@@ 744-765 (lines=22) @@
741
     *
742
     * @see \eZ\Publish\Core\Repository\URLService::loadByUrl
743
     */
744
    public function testLoadByUrl()
745
    {
746
        $repository = $this->getRepository();
747
748
        $urlAddr = '/content/view/sitemap/2';
749
        /* BEGIN: Use Case */
750
        $urlService = $repository->getURLService();
751
752
        $url = $urlService->loadByUrl($urlAddr);
753
754
        /* END: Use Case */
755
756
        $this->assertInstanceOf(URL::class, $url);
757
        $this->assertPropertiesCorrect([
758
            'id' => 23,
759
            'url' => '/content/view/sitemap/2',
760
            'isValid' => true,
761
            'lastChecked' => null,
762
            'created' => new DateTime('@1343140541'),
763
            'modified' => new DateTime('@1343140541'),
764
        ], $url);
765
    }
766
767
    /**
768
     * Test for URLService::loadByUrl() method.