Code Duplication    Length = 25-26 lines in 2 locations

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

@@ 960-985 (lines=26) @@
957
     * @see \eZ\Publish\API\Repository\LocationService::loadLocationChildren($location, $offset)
958
     * @depends eZ\Publish\API\Repository\Tests\LocationServiceTest::testLoadLocationChildrenWithOffset
959
     */
960
    public function testLoadLocationChildrenDataWithOffset(LocationList $locations)
961
    {
962
        $this->assertEquals(3, count($locations->locations));
963
        $this->assertEquals(5, $locations->totalCount);
964
965
        foreach ($locations->locations as $location) {
966
            $this->assertInstanceOf(
967
                '\\eZ\\Publish\\API\\Repository\\Values\\Content\\Location',
968
                $location
969
            );
970
        }
971
972
        $this->assertEquals(
973
            array(
974
                $this->generateId('location', 14),
975
                $this->generateId('location', 44),
976
                $this->generateId('location', 61),
977
            ),
978
            array_map(
979
                function (Location $location) {
980
                    return $location->id;
981
                },
982
                $locations->locations
983
            )
984
        );
985
    }
986
987
    /**
988
     * Test for the loadLocationChildren() method.
@@ 1024-1048 (lines=25) @@
1021
     * @see \eZ\Publish\API\Repository\LocationService::loadLocationChildren($location, $offset, $limit)
1022
     * @depends eZ\Publish\API\Repository\Tests\LocationServiceTest::testLoadLocationChildrenWithOffsetAndLimit
1023
     */
1024
    public function testLoadLocationChildrenDataWithOffsetAndLimit(LocationList $locations)
1025
    {
1026
        $this->assertEquals(2, count($locations->locations));
1027
        $this->assertEquals(5, $locations->totalCount);
1028
1029
        foreach ($locations->locations as $location) {
1030
            $this->assertInstanceOf(
1031
                '\\eZ\\Publish\\API\\Repository\\Values\\Content\\Location',
1032
                $location
1033
            );
1034
        }
1035
1036
        $this->assertEquals(
1037
            array(
1038
                $this->generateId('location', 14),
1039
                $this->generateId('location', 44),
1040
            ),
1041
            array_map(
1042
                function (Location $location) {
1043
                    return $location->id;
1044
                },
1045
                $locations->locations
1046
            )
1047
        );
1048
    }
1049
1050
    /**
1051
     * Test for the newLocationUpdateStruct() method.