Code Duplication    Length = 15-19 lines in 2 locations

eZ/Publish/API/Repository/Tests/LocationServiceTest.php 1 location

@@ 671-685 (lines=15) @@
668
     * @see \eZ\Publish\API\Repository\LocationService::loadLocationByRemoteId()
669
     * @depends eZ\Publish\API\Repository\Tests\LocationServiceTest::testLoadLocation
670
     */
671
    public function testLoadLocationByRemoteIdThrowsNotFoundException()
672
    {
673
        $this->expectException(\eZ\Publish\API\Repository\Exceptions\NotFoundException::class);
674
675
        $repository = $this->getRepository();
676
677
        /* BEGIN: Use Case */
678
        $locationService = $repository->getLocationService();
679
680
        // Throws exception, since Location with remote ID does not exist
681
        $location = $locationService->loadLocationByRemoteId(
682
            'not-exists'
683
        );
684
        /* END: Use Case */
685
    }
686
687
    /**
688
     * Test for the loadLocations() method.

eZ/Publish/API/Repository/Tests/TrashServiceTest.php 1 location

@@ 94-112 (lines=19) @@
91
     * @see \eZ\Publish\API\Repository\TrashService::trash()
92
     * @depends eZ\Publish\API\Repository\Tests\TrashServiceTest::testTrash
93
     */
94
    public function testTrashRemovesLocationFromMainStorage()
95
    {
96
        $this->expectException(\eZ\Publish\API\Repository\Exceptions\NotFoundException::class);
97
98
        $repository = $this->getRepository();
99
100
        $mediaRemoteId = '75c715a51699d2d309a924eca6a95145';
101
102
        /* BEGIN: Use Case */
103
        $this->createTrashItem();
104
105
        // Load the location service
106
        $locationService = $repository->getLocationService();
107
108
        // This call will fail with a "NotFoundException", because the media
109
        // location was marked as trashed in the main storage
110
        $locationService->loadLocationByRemoteId($mediaRemoteId);
111
        /* END: Use Case */
112
    }
113
114
    /**
115
     * Test for the trash() method.