Skip to content

Commit

Permalink
Add implementsInterface() unit test cases with objects
Browse files Browse the repository at this point in the history
  • Loading branch information
herndlm committed Oct 7, 2022
1 parent d31ce4b commit 9ff015b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tests/AssertTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

use ArrayIterator;
use ArrayObject;
use DateTimeImmutable;
use Error;
use Exception;
use LogicException;
Expand Down Expand Up @@ -445,6 +446,10 @@ public function getTests()
array('interfaceExists', array(__CLASS__), false),
array('implementsInterface', array('ArrayIterator', 'Traversable'), true),
array('implementsInterface', array(__CLASS__, 'Traversable'), false),
array('implementsInterface', array(new DateTimeImmutable(), 'DateTimeInterface'), true),
array('implementsInterface', array(new DateTimeImmutable(), 'Traversable'), false),
array('implementsInterface', array(new ArrayIterator([]), 'DateTimeInterface'), false),
array('implementsInterface', array(new ArrayIterator([]), 'Traversable'), true),
array('propertyExists', array((object) array('property' => 0), 'property'), true),
array('propertyExists', array((object) array('property' => null), 'property'), true),
array('propertyExists', array((object) array('property' => null), 'foo'), false),
Expand Down

0 comments on commit 9ff015b

Please sign in to comment.