Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / web / core / tests / Drupal / Tests / Component / Diff / Engine / DiffOpTest.php
1 <?php
2
3 namespace Drupal\Tests\Component\Diff\Engine;
4
5 use Drupal\Component\Diff\Engine\DiffOp;
6 use PHPUnit\Framework\TestCase;
7 use PHPUnit\Framework\Error\Error;
8
9 /**
10  * Test DiffOp base class.
11  *
12  * The only significant behavior here is that ::reverse() should throw an error
13  * if not overridden. In versions of this code in other projects, reverse() is
14  * marked as abstract, which enforces some of this behavior.
15  *
16  * @coversDefaultClass \Drupal\Component\Diff\Engine\DiffOp
17  *
18  * @group Diff
19  */
20 class DiffOpTest extends TestCase {
21
22   /**
23    * DiffOp::reverse() always throws an error.
24    *
25    * @covers ::reverse
26    */
27   public function testReverse() {
28     if (method_exists($this, 'expectException')) {
29       $this->expectException(Error::class);
30     }
31     else {
32       $this->setExpectedException(\PHPUnit_Framework_Error::class);
33     }
34     $op = new DiffOp();
35     $result = $op->reverse();
36   }
37
38 }