X-Git-Url: http://www.aleph1.co.uk/gitweb/?a=blobdiff_plain;ds=sidebyside;f=web%2Fmodules%2Fcontrib%2Ftoken%2Ftests%2Fsrc%2FKernel%2FArrayTest.php;h=d484835b561bcadbecb04c94b4b49afae8a1640b;hb=059867c3f96750652c80f39e44c442a58c2549ee;hp=a7f83ae4dded65e42736fd339fee8bc338d9f824;hpb=f8fc16ae6b862bef59baaad5d051dd37b7ff11b2;p=yaffs-website diff --git a/web/modules/contrib/token/tests/src/Kernel/ArrayTest.php b/web/modules/contrib/token/tests/src/Kernel/ArrayTest.php index a7f83ae4d..d484835b5 100644 --- a/web/modules/contrib/token/tests/src/Kernel/ArrayTest.php +++ b/web/modules/contrib/token/tests/src/Kernel/ArrayTest.php @@ -11,8 +11,8 @@ class ArrayTest extends KernelTestBase { function testArrayTokens() { // Test a simple array. - $array = array(0 => 'a', 1 => 'b', 2 => 'c', 4 => 'd'); - $tokens = array( + $array = [0 => 'a', 1 => 'b', 2 => 'c', 4 => 'd']; + $tokens = [ 'first' => 'a', 'last' => 'd', 'value:0' => 'a', @@ -27,19 +27,19 @@ class ArrayTest extends KernelTestBase { 'join' => 'abcd', 'join:, ' => 'a, b, c, d', 'join: ' => 'a b c d', - ); - $this->assertTokens('array', array('array' => $array), $tokens); + ]; + $this->assertTokens('array', ['array' => $array], $tokens); // Test a mixed simple and render array. // 2 => c, 0 => a, 4 => d, 1 => b - $array = array( + $array = [ '#property' => 'value', 0 => 'a', - 1 => array('#markup' => 'b', '#weight' => 0.01), - 2 => array('#markup' => 'c', '#weight' => -10), - 4 => array('#markup' => 'd', '#weight' => 0), - ); - $tokens = array( + 1 => ['#markup' => 'b', '#weight' => 0.01], + 2 => ['#markup' => 'c', '#weight' => -10], + 4 => ['#markup' => 'd', '#weight' => 0], + ]; + $tokens = [ 'first' => 'c', 'last' => 'b', 'value:0' => 'a', @@ -54,7 +54,8 @@ class ArrayTest extends KernelTestBase { 'join' => 'cadb', 'join:, ' => 'c, a, d, b', 'join: ' => 'c a d b', - ); - $this->assertTokens('array', array('array' => $array), $tokens); + ]; + $this->assertTokens('array', ['array' => $array], $tokens); } + }