From f63d0d11ebc643efe1e4f40e2aaa9301b4cc4e78 Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Tue, 18 Nov 2014 13:20:13 -0500 Subject: [PATCH] Add test for CRM_Utils_Array::remove --- tests/phpunit/CRM/Utils/ArrayTest.php | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/tests/phpunit/CRM/Utils/ArrayTest.php b/tests/phpunit/CRM/Utils/ArrayTest.php index ced61fc279..0ae70b9594 100644 --- a/tests/phpunit/CRM/Utils/ArrayTest.php +++ b/tests/phpunit/CRM/Utils/ArrayTest.php @@ -6,17 +6,6 @@ require_once 'CiviTest/CiviUnitTestCase.php'; */ class CRM_Utils_ArrayTest extends CiviUnitTestCase { - /** - * @return null - */ - private function &returnByReference() { - static $foo; - if ($foo === NULL) { - $foo['foo'] = 'original'; - } - return $foo; - } - function testIndexArray() { $inputs = array(); $inputs[] = array( @@ -124,4 +113,17 @@ class CRM_Utils_ArrayTest extends CiviUnitTestCase { $this->assertFalse(CRM_Utils_Array::isSubset(array('a'), array('b'))); $this->assertFalse(CRM_Utils_Array::isSubset(array('a'), array('b','c','d'))); } + + function testRemove() { + $data = array( + 'one' => 1, + 'two' => 2, + 'three' => 3, + 'four' => 4, + 'five' => 5, + 'six' => 6, + ); + CRM_Utils_Array::remove($data, 'one', 'two', array('three', 'four'), 'five'); + $this->assertEquals($data, array('six' => 6)); + } } -- 2.25.1