Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / web / core / tests / Drupal / Tests / Component / Plugin / Discovery / StaticDiscoveryDecoratorTest.php
index a44721bd9b4e76d49f3981fcc6188cb35b08cf97..5b010930922a17d25766ddc9b38d8b4b6e6deaa7 100644 (file)
@@ -100,7 +100,12 @@ class StaticDiscoveryDecoratorTest extends TestCase {
     $ref_decorated->setValue($mock_decorator, $mock_decorated);
 
     if ($exception_on_invalid) {
-      $this->setExpectedException('Drupal\Component\Plugin\Exception\PluginNotFoundException');
+      if (method_exists($this, 'expectException')) {
+        $this->expectException('Drupal\Component\Plugin\Exception\PluginNotFoundException');
+      }
+      else {
+        $this->setExpectedException('Drupal\Component\Plugin\Exception\PluginNotFoundException');
+      }
     }
 
     // Exercise getDefinition(). It calls parent::getDefinition().