Code Duplication    Length = 22-22 lines in 2 locations

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

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