From 9fd3215e5ee34092ab1f469c8e54e7b7091f67fd Mon Sep 17 00:00:00 2001 From: Aidan Saunders Date: Thu, 29 Nov 2018 12:59:13 +0000 Subject: [PATCH] Add new testing helper: assertArrayValuesEqual($a1, $a2) - compare array values --- tests/phpunit/CiviTest/CiviUnitTestCase.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/phpunit/CiviTest/CiviUnitTestCase.php b/tests/phpunit/CiviTest/CiviUnitTestCase.php index 76a9d3f5c7..b7934784a8 100644 --- a/tests/phpunit/CiviTest/CiviUnitTestCase.php +++ b/tests/phpunit/CiviTest/CiviUnitTestCase.php @@ -684,6 +684,18 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase { ); } + /** + * @param $expected + * @param $actual + */ + public function assertArrayValuesEqual($array1, $array2) { + $array1 = array_values($array1); + $array2 = array_values($array2); + sort($array1); + sort($array2); + $this->assertEquals($array1, $array2); + } + /** * @param $expected * @param $actual -- 2.25.1