Code Duplication    Length = 15-17 lines in 2 locations

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

@@ 602-616 (lines=15) @@
599
     * @see \eZ\Publish\API\Repository\LocationService::loadLocation()
600
     * @depends eZ\Publish\API\Repository\Tests\LocationServiceTest::testCreateLocation
601
     */
602
    public function testLoadLocationThrowsNotFoundException()
603
    {
604
        $this->expectException(\eZ\Publish\API\Repository\Exceptions\NotFoundException::class);
605
606
        $repository = $this->getRepository();
607
608
        $nonExistentLocationId = $this->generateId('location', 2342);
609
        /* BEGIN: Use Case */
610
        $locationService = $repository->getLocationService();
611
612
        // Throws exception, if Location with $nonExistentLocationId does not
613
        // exist
614
        $location = $locationService->loadLocation($nonExistentLocationId);
615
        /* END: Use Case */
616
    }
617
618
    /**
619
     * Test for the loadLocationList() method.
@@ 731-747 (lines=17) @@
728
     * @see \eZ\Publish\API\Repository\LocationService::loadLocationByRemoteId()
729
     * @depends eZ\Publish\API\Repository\Tests\LocationServiceTest::testLoadLocation
730
     */
731
    public function testLoadLocationByRemoteId()
732
    {
733
        $repository = $this->getRepository();
734
735
        /* BEGIN: Use Case */
736
        $locationService = $repository->getLocationService();
737
738
        $location = $locationService->loadLocationByRemoteId(
739
            '3f6d92f8044aed134f32153517850f5a'
740
        );
741
        /* END: Use Case */
742
743
        $this->assertEquals(
744
            $locationService->loadLocation($this->generateId('location', 5)),
745
            $location
746
        );
747
    }
748
749
    /**
750
     * Test for the loadLocationByRemoteId() method.