Code Duplication    Length = 25-26 lines in 2 locations

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

@@ 974-999 (lines=26) @@
971
     * @see \eZ\Publish\API\Repository\LocationService::loadLocationChildren($location, $offset)
972
     * @depends eZ\Publish\API\Repository\Tests\LocationServiceTest::testLoadLocationChildrenWithOffset
973
     */
974
    public function testLoadLocationChildrenDataWithOffset(LocationList $locations)
975
    {
976
        $this->assertEquals(3, count($locations->locations));
977
        $this->assertEquals(5, $locations->totalCount);
978
979
        foreach ($locations->locations as $location) {
980
            $this->assertInstanceOf(
981
                '\\eZ\\Publish\\API\\Repository\\Values\\Content\\Location',
982
                $location
983
            );
984
        }
985
986
        $this->assertEquals(
987
            array(
988
                $this->generateId('location', 14),
989
                $this->generateId('location', 44),
990
                $this->generateId('location', 61),
991
            ),
992
            array_map(
993
                function (Location $location) {
994
                    return $location->id;
995
                },
996
                $locations->locations
997
            )
998
        );
999
    }
1000
1001
    /**
1002
     * Test for the loadLocationChildren() method.
@@ 1038-1062 (lines=25) @@
1035
     * @see \eZ\Publish\API\Repository\LocationService::loadLocationChildren($location, $offset, $limit)
1036
     * @depends eZ\Publish\API\Repository\Tests\LocationServiceTest::testLoadLocationChildrenWithOffsetAndLimit
1037
     */
1038
    public function testLoadLocationChildrenDataWithOffsetAndLimit(LocationList $locations)
1039
    {
1040
        $this->assertEquals(2, count($locations->locations));
1041
        $this->assertEquals(5, $locations->totalCount);
1042
1043
        foreach ($locations->locations as $location) {
1044
            $this->assertInstanceOf(
1045
                '\\eZ\\Publish\\API\\Repository\\Values\\Content\\Location',
1046
                $location
1047
            );
1048
        }
1049
1050
        $this->assertEquals(
1051
            array(
1052
                $this->generateId('location', 14),
1053
                $this->generateId('location', 44),
1054
            ),
1055
            array_map(
1056
                function (Location $location) {
1057
                    return $location->id;
1058
                },
1059
                $locations->locations
1060
            )
1061
        );
1062
    }
1063
1064
    /**
1065
     * Test for the newLocationUpdateStruct() method.