Code Duplication    Length = 22-22 lines in 2 locations

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

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