Code Duplication    Length = 15-19 lines in 2 locations

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.

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

@@ 757-771 (lines=15) @@
754
     * @see \eZ\Publish\API\Repository\LocationService::loadLocationByRemoteId()
755
     * @depends eZ\Publish\API\Repository\Tests\LocationServiceTest::testLoadLocation
756
     */
757
    public function testLoadLocationByRemoteIdThrowsNotFoundException()
758
    {
759
        $this->expectException(\eZ\Publish\API\Repository\Exceptions\NotFoundException::class);
760
761
        $repository = $this->getRepository();
762
763
        /* BEGIN: Use Case */
764
        $locationService = $repository->getLocationService();
765
766
        // Throws exception, since Location with remote ID does not exist
767
        $location = $locationService->loadLocationByRemoteId(
768
            'not-exists'
769
        );
770
        /* END: Use Case */
771
    }
772
773
    /**
774
     * Test for the loadLocations() method.