Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / web / core / tests / Drupal / Tests / Component / Diff / Engine / DiffOpTest.php
index 1a649ae510c7733dd7c65a647e517799a827b49e..dbbb6ec08176057fde7bc5b0c3dcd0778caf05ff 100644 (file)
@@ -4,6 +4,7 @@ namespace Drupal\Tests\Component\Diff\Engine;
 
 use Drupal\Component\Diff\Engine\DiffOp;
 use PHPUnit\Framework\TestCase;
+use PHPUnit\Framework\Error\Error;
 
 /**
  * Test DiffOp base class.
@@ -24,7 +25,12 @@ class DiffOpTest extends TestCase {
    * @covers ::reverse
    */
   public function testReverse() {
-    $this->setExpectedException(\PHPUnit_Framework_Error::class);
+    if (method_exists($this, 'expectException')) {
+      $this->expectException(Error::class);
+    }
+    else {
+      $this->setExpectedException(\PHPUnit_Framework_Error::class);
+    }
     $op = new DiffOp();
     $result = $op->reverse();
   }