Code Duplication    Length = 17-18 lines in 2 locations

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

@@ 130-147 (lines=18) @@
127
     * @expectedException \eZ\Publish\API\Repository\Exceptions\UnauthorizedException
128
     * @depends eZ\Publish\API\Repository\Tests\LocationServiceTest::testLoadLocation
129
     */
130
    public function testLoadLocationThrowsUnauthorizedException()
131
    {
132
        $repository = $this->getRepository();
133
134
        $editorsGroupId = $this->generateId('group', 13);
135
136
        /* BEGIN: Use Case */
137
        $locationService = $repository->getLocationService();
138
139
        $user = $this->createUserVersion1();
140
141
        // Set current user to newly created user
142
        $repository->setCurrentUser($user);
143
144
        // This call will fail with an "UnauthorizedException"
145
        $locationService->loadLocation($editorsGroupId);
146
        /* END: Use Case */
147
    }
148
149
    /**
150
     * Test for the loadLocationList() method.

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

@@ 727-743 (lines=17) @@
724
     * @see \eZ\Publish\API\Repository\LocationService::loadLocationByRemoteId()
725
     * @depends eZ\Publish\API\Repository\Tests\LocationServiceTest::testLoadLocation
726
     */
727
    public function testLoadLocationByRemoteId()
728
    {
729
        $repository = $this->getRepository();
730
731
        /* BEGIN: Use Case */
732
        $locationService = $repository->getLocationService();
733
734
        $location = $locationService->loadLocationByRemoteId(
735
            '3f6d92f8044aed134f32153517850f5a'
736
        );
737
        /* END: Use Case */
738
739
        $this->assertEquals(
740
            $locationService->loadLocation($this->generateId('location', 5)),
741
            $location
742
        );
743
    }
744
745
    /**
746
     * Test for the loadLocationByRemoteId() method.