From 9ff015b21fd05a11252d34089d1657bb81b2403b Mon Sep 17 00:00:00 2001 From: Martin Herndl Date: Fri, 7 Oct 2022 20:55:37 +0200 Subject: [PATCH] Add `implementsInterface()` unit test cases with objects --- tests/AssertTest.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/AssertTest.php b/tests/AssertTest.php index 567fddf..ebedc02 100644 --- a/tests/AssertTest.php +++ b/tests/AssertTest.php @@ -13,6 +13,7 @@ use ArrayIterator; use ArrayObject; +use DateTimeImmutable; use Error; use Exception; use LogicException; @@ -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),