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

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