Code Duplication    Length = 22-22 lines in 2 locations

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

@@ 723-744 (lines=22) @@
720
     *
721
     * @see \eZ\Publish\Core\Repository\URLService::loadById
722
     */
723
    public function testLoadById()
724
    {
725
        $repository = $this->getRepository();
726
727
        $id = $this->generateId('url', 23);
728
729
        /* BEGIN: Use Case */
730
        $urlService = $repository->getURLService();
731
732
        $url = $urlService->loadById($id);
733
        /* END: Use Case */
734
735
        $this->assertInstanceOf(URL::class, $url);
736
        $this->assertPropertiesCorrect([
737
            'id' => 23,
738
            'url' => '/content/view/sitemap/2',
739
            'isValid' => true,
740
            'lastChecked' => null,
741
            'created' => new DateTime('@1343140541'),
742
            'modified' => new DateTime('@1343140541'),
743
        ], $url);
744
    }
745
746
    /**
747
     * Test for URLService::loadById() method.
@@ 772-793 (lines=22) @@
769
     *
770
     * @see \eZ\Publish\Core\Repository\URLService::loadByUrl
771
     */
772
    public function testLoadByUrl()
773
    {
774
        $repository = $this->getRepository();
775
776
        $urlAddr = '/content/view/sitemap/2';
777
        /* BEGIN: Use Case */
778
        $urlService = $repository->getURLService();
779
780
        $url = $urlService->loadByUrl($urlAddr);
781
782
        /* END: Use Case */
783
784
        $this->assertInstanceOf(URL::class, $url);
785
        $this->assertPropertiesCorrect([
786
            'id' => 23,
787
            'url' => '/content/view/sitemap/2',
788
            'isValid' => true,
789
            'lastChecked' => null,
790
            'created' => new DateTime('@1343140541'),
791
            'modified' => new DateTime('@1343140541'),
792
        ], $url);
793
    }
794
795
    /**
796
     * Test for URLService::loadByUrl() method.