Code Duplication    Length = 18-18 lines in 4 locations

src/Oro/Component/PhpUtils/Tests/Unit/ArrayUtilTest.php 4 locations

@@ 259-276 (lines=18) @@
256
        );
257
    }
258
259
    public function testSortByArrayString()
260
    {
261
        $array = [
262
            ['name' => 'a'],
263
            ['name' => 'c'],
264
            ['name' => 'b'],
265
        ];
266
267
        ArrayUtil::sortBy($array, false, 'name', SORT_STRING);
268
        $this->assertSame(
269
            [
270
                ['name' => 'a'],
271
                ['name' => 'b'],
272
                ['name' => 'c'],
273
            ],
274
            $array
275
        );
276
    }
277
278
    public function testSortByArrayStringReverse()
279
    {
@@ 278-295 (lines=18) @@
275
        );
276
    }
277
278
    public function testSortByArrayStringReverse()
279
    {
280
        $array = [
281
            ['name' => 'a'],
282
            ['name' => 'c'],
283
            ['name' => 'b'],
284
        ];
285
286
        ArrayUtil::sortBy($array, true, 'name', SORT_STRING);
287
        $this->assertSame(
288
            [
289
                ['name' => 'c'],
290
                ['name' => 'b'],
291
                ['name' => 'a'],
292
            ],
293
            $array
294
        );
295
    }
296
297
    public function testSortByArrayStringCaseInsensitive()
298
    {
@@ 297-314 (lines=18) @@
294
        );
295
    }
296
297
    public function testSortByArrayStringCaseInsensitive()
298
    {
299
        $array = [
300
            ['name' => 'a'],
301
            ['name' => 'C'],
302
            ['name' => 'B'],
303
        ];
304
305
        ArrayUtil::sortBy($array, false, 'name', SORT_STRING | SORT_FLAG_CASE);
306
        $this->assertSame(
307
            [
308
                ['name' => 'a'],
309
                ['name' => 'B'],
310
                ['name' => 'C'],
311
            ],
312
            $array
313
        );
314
    }
315
316
    public function testSortByArrayStringCaseInsensitiveReverse()
317
    {
@@ 316-333 (lines=18) @@
313
        );
314
    }
315
316
    public function testSortByArrayStringCaseInsensitiveReverse()
317
    {
318
        $array = [
319
            ['name' => 'a'],
320
            ['name' => 'C'],
321
            ['name' => 'B'],
322
        ];
323
324
        ArrayUtil::sortBy($array, true, 'name', SORT_STRING | SORT_FLAG_CASE);
325
        $this->assertSame(
326
            [
327
                ['name' => 'C'],
328
                ['name' => 'B'],
329
                ['name' => 'a'],
330
            ],
331
            $array
332
        );
333
    }
334
335
    public function testSortByArrayPath()
336
    {