Code Duplication    Length = 3-6 lines in 3 locations

eZ/Publish/API/Repository/Tests/RoleServiceTest.php 3 locations

@@ 972-977 (lines=6) @@
969
        /* END: Use Case */
970
971
        $actual = [];
972
        foreach ($roleDraft->getPolicies() as $policy) {
973
            $actual[] = [
974
                'module' => $policy->module,
975
                'function' => $policy->function,
976
            ];
977
        }
978
        usort(
979
            $actual,
980
            function ($p1, $p2) {
@@ 1138-1140 (lines=3) @@
1135
        $role = $roleService->loadRole($roleDraft->id);
1136
1137
        $policies = [];
1138
        foreach ($role->getPolicies() as $policy) {
1139
            $policies[] = ['module' => $policy->module, 'function' => $policy->function];
1140
        }
1141
        /* END: Use Case */
1142
        array_multisort($policies);
1143
@@ 1196-1198 (lines=3) @@
1193
        $roleDraft = $roleService->createRole($roleCreate);
1194
1195
        $policies = [];
1196
        foreach ($roleDraft->getPolicies() as $policy) {
1197
            $policies[] = ['module' => $policy->module, 'function' => $policy->function];
1198
        }
1199
        /* END: Use Case */
1200
1201
        $this->assertEquals(