Code Duplication    Length = 19-21 lines in 2 locations

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

@@ 33-53 (lines=21) @@
30
     *
31
     * @see \eZ\Publish\API\Repository\LocationService::newLocationCreateStruct()
32
     */
33
    public function testNewLocationCreateStruct()
34
    {
35
        $repository = $this->getRepository();
36
37
        $parentLocationId = $this->generateId('location', 1);
38
        /* BEGIN: Use Case */
39
        // $parentLocationId is the ID of an existing location
40
        $locationService = $repository->getLocationService();
41
42
        $locationCreate = $locationService->newLocationCreateStruct(
43
            $parentLocationId
44
        );
45
        /* END: Use Case */
46
47
        $this->assertInstanceOf(
48
            '\\eZ\\Publish\\API\\Repository\\Values\\Content\\LocationCreateStruct',
49
            $locationCreate
50
        );
51
52
        return $locationCreate;
53
    }
54
55
    /**
56
     * Test for the newLocationCreateStruct() method.
@@ 314-332 (lines=19) @@
311
     * @see \eZ\Publish\API\Repository\LocationService::loadLocation()
312
     * @depends eZ\Publish\API\Repository\Tests\LocationServiceTest::testCreateLocation
313
     */
314
    public function testLoadLocation()
315
    {
316
        $repository = $this->getRepository();
317
318
        $locationId = $this->generateId('location', 5);
319
        /* BEGIN: Use Case */
320
        // $locationId is the ID of an existing location
321
        $locationService = $repository->getLocationService();
322
323
        $location = $locationService->loadLocation($locationId);
324
        /* END: Use Case */
325
326
        $this->assertInstanceOf(
327
            '\\eZ\\Publish\\API\\Repository\\Values\\Content\\Location',
328
            $location
329
        );
330
331
        return $location;
332
    }
333
334
    /**
335
     * Test for the loadLocation() method.