Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / web / core / tests / Drupal / Tests / Component / Serialization / YamlPeclTest.php
index c2e0a0d888ee89247b11ee198825ce3b940dd852..5a71f483810193d20518014de91728905db9c3f4 100644 (file)
@@ -87,7 +87,12 @@ foo:
    * @covers ::errorHandler
    */
   public function testError() {
-    $this->setExpectedException(InvalidDataTypeException::class);
+    if (method_exists($this, 'expectException')) {
+      $this->expectException(InvalidDataTypeException::class);
+    }
+    else {
+      $this->setExpectedException(InvalidDataTypeException::class);
+    }
     YamlPecl::decode('foo: [ads');
   }