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

@@ 687-703 (lines=17) @@
684
     * @see \eZ\Publish\API\Repository\LocationService::loadLocationByRemoteId()
685
     * @depends eZ\Publish\API\Repository\Tests\LocationServiceTest::testLoadLocation
686
     */
687
    public function testLoadLocationByRemoteId()
688
    {
689
        $repository = $this->getRepository();
690
691
        /* BEGIN: Use Case */
692
        $locationService = $repository->getLocationService();
693
694
        $location = $locationService->loadLocationByRemoteId(
695
            '3f6d92f8044aed134f32153517850f5a'
696
        );
697
        /* END: Use Case */
698
699
        $this->assertEquals(
700
            $locationService->loadLocation($this->generateId('location', 5)),
701
            $location
702
        );
703
    }
704
705
    /**
706
     * Test for the loadLocationByRemoteId() method.