From a8d721ebdb825495a9da6f09dd919fccdb97c351 Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Fri, 29 Jun 2018 16:31:11 -0700 Subject: [PATCH] (dev/core#174) NaiveMultipleTrait - Fix validation of oddball iterables --- CRM/Utils/Cache/NaiveMultipleTrait.php | 2 +- tests/phpunit/E2E/Cache/CacheTestCase.php | 9 --------- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/CRM/Utils/Cache/NaiveMultipleTrait.php b/CRM/Utils/Cache/NaiveMultipleTrait.php index ac7e4dedb8..d7ead9fc94 100644 --- a/CRM/Utils/Cache/NaiveMultipleTrait.php +++ b/CRM/Utils/Cache/NaiveMultipleTrait.php @@ -113,7 +113,7 @@ trait CRM_Utils_Cache_NaiveMultipleTrait { * @throws \CRM_Utils_Cache_InvalidArgumentException */ private function assertIterable($func, $keys) { - if (!is_array($keys) || $keys instanceof Traversable) { + if (!is_array($keys) && !($keys instanceof Traversable)) { throw new CRM_Utils_Cache_InvalidArgumentException("$func expects iterable input"); } } diff --git a/tests/phpunit/E2E/Cache/CacheTestCase.php b/tests/phpunit/E2E/Cache/CacheTestCase.php index 67c06ba2d0..e8c1d8b837 100644 --- a/tests/phpunit/E2E/Cache/CacheTestCase.php +++ b/tests/phpunit/E2E/Cache/CacheTestCase.php @@ -46,15 +46,6 @@ abstract class E2E_Cache_CacheTestCase extends \Cache\IntegrationTests\LegacySim parent::setUpBeforeClass(); } - protected function setUp() { - parent::setUp(); - // Testing on PHP 5.5 and having trouble finding a test that correctly - // detects generators. - $this->skippedTests['testGetMultipleWithGenerator'] = 1; - $this->skippedTests['testSetMultipleWithGenerator'] = 1; - $this->skippedTests['testDeleteMultipleGenerator'] = 1; - } - public function testBasicUsageWithLongKey() { if (isset($this->skippedTests[__FUNCTION__])) { $this->markTestSkipped($this->skippedTests[__FUNCTION__]); -- 2.25.1