Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / web / core / tests / Drupal / Tests / Component / Utility / RectangleTest.php
index 49d08333ef4cecd2d9e5161e6b0298895527cfc9..ef46b7963af3a6bdec054fa53536516877435fc7 100644 (file)
@@ -17,7 +17,12 @@ class RectangleTest extends TestCase {
    * @covers ::rotate
    */
   public function testWrongWidth() {
-    $this->setExpectedException(\InvalidArgumentException::class);
+    if (method_exists($this, 'expectException')) {
+      $this->expectException(\InvalidArgumentException::class);
+    }
+    else {
+      $this->setExpectedException(\InvalidArgumentException::class);
+    }
     $rect = new Rectangle(-40, 20);
   }
 
@@ -27,7 +32,12 @@ class RectangleTest extends TestCase {
    * @covers ::rotate
    */
   public function testWrongHeight() {
-    $this->setExpectedException(\InvalidArgumentException::class);
+    if (method_exists($this, 'expectException')) {
+      $this->expectException(\InvalidArgumentException::class);
+    }
+    else {
+      $this->setExpectedException(\InvalidArgumentException::class);
+    }
     $rect = new Rectangle(40, 0);
   }