@@ -117,6 +117,39 @@ public function shouldAcceptStaticClassCallbackWithIntersectionTypehint()
117117 self ::assertTrue (_checkTypehint (['React\Promise\CallbackWithIntersectionTypehintClass ' , 'testCallbackStatic ' ], new CountableException ()));
118118 }
119119
120+ /**
121+ * @test
122+ * @requires PHP 8.2
123+ */
124+ public function shouldAcceptInvokableObjectCallbackWithDNFTypehint ()
125+ {
126+ self ::assertFalse (_checkTypehint (new CallbackWithDNFTypehintClass (), new \RuntimeException ()));
127+ self ::assertTrue (_checkTypehint (new CallbackWithDNFTypehintClass (), new ArrayAccessibleException ()));
128+ self ::assertTrue (_checkTypehint (new CallbackWithDNFTypehintClass (), new CountableException ()));
129+ }
130+
131+ /**
132+ * @test
133+ * @requires PHP 8.2
134+ */
135+ public function shouldAcceptObjectMethodCallbackWithDNFTypehint ()
136+ {
137+ self ::assertFalse (_checkTypehint ([new CallbackWithDNFTypehintClass (), 'testCallback ' ], new \RuntimeException ()));
138+ self ::assertTrue (_checkTypehint ([new CallbackWithDNFTypehintClass (), 'testCallback ' ], new CountableException ()));
139+ self ::assertTrue (_checkTypehint ([new CallbackWithDNFTypehintClass (), 'testCallback ' ], new ArrayAccessibleException ()));
140+ }
141+
142+ /**
143+ * @test
144+ * @requires PHP 8.2
145+ */
146+ public function shouldAcceptStaticClassCallbackWithDNFTypehint ()
147+ {
148+ self ::assertFalse (_checkTypehint (['React\Promise\CallbackWithDNFTypehintClass ' , 'testCallbackStatic ' ], new \RuntimeException ()));
149+ self ::assertTrue (_checkTypehint (['React\Promise\CallbackWithDNFTypehintClass ' , 'testCallbackStatic ' ], new CountableException ()));
150+ self ::assertTrue (_checkTypehint (['React\Promise\CallbackWithDNFTypehintClass ' , 'testCallbackStatic ' ], new ArrayAccessibleException ()));
151+ }
152+
120153 /** @test */
121154 public function shouldAcceptClosureCallbackWithoutTypehint ()
122155 {
0 commit comments