Skip to content
This repository was archived by the owner on Jan 29, 2020. It is now read-only.

Commit 441e8dd

Browse files
committed
fix: Adapt assertion to work with PHP versions < 7.1
Previously, `assertInternalType('iterable')`, which only works on PHP 7.1+.
1 parent 7dc24c8 commit 441e8dd

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

test/ListenerProvider/PrioritizedIdentifierListenerProviderTest.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77

88
namespace ZendTest\EventManager\ListenerProvider;
99

10-
use ArrayIterator;
1110
use PHPUnit\Framework\TestCase;
1211
use Prophecy\Argument;
12+
use Traversable;
1313
use Zend\EventManager\Exception;
1414
use Zend\EventManager\ListenerProvider\PrioritizedIdentifierListenerProvider;
1515

@@ -133,7 +133,8 @@ public function testDetachDoesNothingIfIdentifierDoesNotContainEvent()
133133
public function testProviderReturnsEmptyListWhenNoListenersAttachedForEventAndIdentifier()
134134
{
135135
$test = $this->provider->getListenersForEvent('EVENT', ['IDENTIFIER']);
136-
$this->assertInternalType('iterable', $test);
136+
// instead of assertInternalType('iterable'), which requires PHP 7.1+:
137+
$this->assertTrue(is_array($test) || $test instanceof Traversable);
137138
$this->assertCount(0, $test);
138139
}
139140

0 commit comments

Comments
 (0)