From 15da1bb246a631211bfdc139539c60693854df1f Mon Sep 17 00:00:00 2001 From: sikofitt Date: Wed, 20 Jul 2016 12:49:10 -0700 Subject: [PATCH] fixed array_column function for php version <= 5.5 --- tests/Sikofitt/Tests/ArrayObjectArrayTest.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/Sikofitt/Tests/ArrayObjectArrayTest.php b/tests/Sikofitt/Tests/ArrayObjectArrayTest.php index 0d6a7f2..ba621bf 100644 --- a/tests/Sikofitt/Tests/ArrayObjectArrayTest.php +++ b/tests/Sikofitt/Tests/ArrayObjectArrayTest.php @@ -243,8 +243,10 @@ class ArrayObjectArrayTest extends \PHPUnit_Framework_TestCase $this->assertSame(array_chunk($this->workingArray, 2), $this->arrayObjectArray->array_chunk(2)); $this->assertSame(array_chunk($this->workingArray, 2, true), $this->arrayObjectArray->array_chunk(2, true)); // array_column - // $this->assertSame(array_column($this->workingMultiArray, 'first_name'), $this->arrayObjectArrayMulti->array_column('first_name')); - // $this->assertSame(array_column($this->workingMultiArray, 'first_name', 'id'), $this->arrayObjectArrayMulti->array_column('first_name', 'id')); + if (PHP_VERSION_ID >= 50500) { + $this->assertSame(array_column($this->workingMultiArray, 'first_name'), $this->arrayObjectArrayMulti->array_column('first_name')); + $this->assertSame(array_column($this->workingMultiArray, 'first_name', 'id'), $this->arrayObjectArrayMulti->array_column('first_name', 'id')); + } // array_combine $this->assertSame(array_combine($this->singleArrayOne, $this->singleArrayTwo), $this->arrayObjectSingle->array_combine($this->singleArrayTwo)); // array_count_values