summaryrefslogtreecommitdiffstats
path: root/tests/lib/NaturalSortTest.php
diff options
context:
space:
mode:
authorChristoph Wurst <christoph@winzerhof-wurst.at>2020-03-26 09:30:18 +0100
committerChristoph Wurst <christoph@winzerhof-wurst.at>2020-03-26 16:34:56 +0100
commitb80ebc96748b45fd2e0ba9323308657c4b00b7ec (patch)
treeec20e0ffa2f86b9b54939a83a785407319f94559 /tests/lib/NaturalSortTest.php
parent62403d0932be7d620c7bdadc6b4e13eb496fcd6f (diff)
downloadnextcloud-server-b80ebc96748b45fd2e0ba9323308657c4b00b7ec.tar.gz
nextcloud-server-b80ebc96748b45fd2e0ba9323308657c4b00b7ec.zip
Use the short array syntax, everywhere
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
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',
- )
- ),
- );
+ ]
+ ],
+ ];
}
}