Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'tests/lib/NaturalSortTest.php')
-rw-r--r--tests/lib/NaturalSortTest.php84
1 files changed, 42 insertions, 42 deletions
diff --git a/tests/lib/NaturalSortTest.php b/tests/lib/NaturalSortTest.php
index 50c2d0be9f0..1408a64dadd 100644
--- a/tests/lib/NaturalSortTest.php
+++ b/tests/lib/NaturalSortTest.php
@@ -20,7 +20,7 @@ class NaturalSortTest extends \Test\TestCase {
return;
}
$comparator = \OC\NaturalSort::getInstance();
- usort($array, array($comparator, 'compare'));
+ usort($array, [$comparator, 'compare']);
$this->assertEquals($sorted, $array);
}
@@ -30,7 +30,7 @@ class NaturalSortTest extends \Test\TestCase {
public function testDefaultCollatorCompare($array, $sorted)
{
$comparator = new \OC\NaturalSort(new \OC\NaturalSort_DefaultCollator());
- usort($array, array($comparator, 'compare'));
+ usort($array, [$comparator, 'compare']);
$this->assertEquals($sorted, $array);
}
@@ -41,28 +41,28 @@ class NaturalSortTest extends \Test\TestCase {
*/
public function naturalSortDataProvider()
{
- return array(
+ return [
// different casing
- array(
+ [
// unsorted
- array(
+ [
'aaa',
'bbb',
'BBB',
'AAA'
- ),
+ ],
// sorted
- array(
+ [
'aaa',
'AAA',
'bbb',
'BBB'
- )
- ),
+ ]
+ ],
// numbers
- array(
+ [
// unsorted
- array(
+ [
'124.txt',
'abc1',
'123.txt',
@@ -85,9 +85,9 @@ class NaturalSortTest extends \Test\TestCase {
'zz',
'15.txt',
'15b.txt',
- ),
+ ],
// sorted
- array(
+ [
'15.txt',
'15b.txt',
'123.txt',
@@ -110,12 +110,12 @@ class NaturalSortTest extends \Test\TestCase {
'z',
'za',
'zz',
- )
- ),
+ ]
+ ],
// chinese characters
- array(
+ [
// unsorted
- array(
+ [
'十.txt',
'一.txt',
'二.txt',
@@ -134,9 +134,9 @@ class NaturalSortTest extends \Test\TestCase {
'莫.txt',
'啊.txt',
'123.txt',
- ),
+ ],
// sorted
- array(
+ [
'123.txt',
'abc.txt',
'一.txt',
@@ -155,12 +155,12 @@ class NaturalSortTest extends \Test\TestCase {
'波.txt',
'破.txt',
'莫.txt',
- )
- ),
+ ]
+ ],
// with umlauts
- array(
+ [
// unsorted
- array(
+ [
'öh.txt',
'Äh.txt',
'oh.txt',
@@ -171,9 +171,9 @@ class NaturalSortTest extends \Test\TestCase {
'uh.txt',
'üh.txt',
'äh.txt',
- ),
+ ],
// sorted
- array(
+ [
'ah.txt',
'äh.txt',
'Äh.txt',
@@ -184,9 +184,9 @@ class NaturalSortTest extends \Test\TestCase {
'üh.txt',
'Üh.txt',
'Üh 2.txt',
- )
- ),
- );
+ ]
+ ],
+ ];
}
/**
@@ -196,28 +196,28 @@ class NaturalSortTest extends \Test\TestCase {
*/
public function defaultCollatorDataProvider()
{
- return array(
+ return [
// different casing
- array(
+ [
// unsorted
- array(
+ [
'aaa',
'bbb',
'BBB',
'AAA'
- ),
+ ],
// sorted
- array(
+ [
'aaa',
'AAA',
'bbb',
'BBB'
- )
- ),
+ ]
+ ],
// numbers
- array(
+ [
// unsorted
- array(
+ [
'124.txt',
'abc1',
'123.txt',
@@ -240,9 +240,9 @@ class NaturalSortTest extends \Test\TestCase {
'zz',
'15.txt',
'15b.txt',
- ),
+ ],
// sorted
- array(
+ [
'15.txt',
'15b.txt',
'123.txt',
@@ -265,8 +265,8 @@ class NaturalSortTest extends \Test\TestCase {
'z',
'za',
'zz',
- )
- ),
- );
+ ]
+ ],
+ ];
}
}