File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change 1111use Http \HttplugBundle \Collector \StackPlugin ;
1212use Http \Promise \FulfilledPromise ;
1313use Http \Promise \RejectedPromise ;
14- use PHPUnit \Framework \Error \Warning ;
1514use PHPUnit \Framework \TestCase ;
1615use Psr \Http \Message \RequestInterface ;
1716use Psr \Http \Message \ResponseInterface ;
@@ -188,8 +187,17 @@ public function testOnError()
188187 $ this ->markTestSkipped ();
189188 }
190189
191- //PHPUnit wrap any \Error into a \PHPUnit\Framework\Error\Warning.
192- $ this ->expectException (Warning::class);
190+ /*
191+ * Use the correct PHPUnit version
192+ * PHPUnit wrap any \Error into a \PHPUnit_Framework_Error. So we are expecting the
193+ */
194+ if (class_exists ('PHPUnit_Framework_Error ' )) {
195+ // PHPUnit 5.7
196+ $ this ->setExpectedException (\PHPUnit_Framework_Error::class);
197+ } else {
198+ // PHPUnit 6.0 and above
199+ $ this ->expectException (\PHPUnit \Framework \Error \Warning::class);
200+ }
193201
194202 $ this ->collector
195203 ->expects ($ this ->once ())
You can’t perform that action at this time.
0 commit comments