Code Duplication    Length = 22-22 lines in 2 locations

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

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