3 namespace Drupal\Tests\Component\Diff\Engine;
5 use Drupal\Component\Diff\Engine\DiffOp;
6 use PHPUnit\Framework\TestCase;
7 use PHPUnit\Framework\Error\Error;
10 * Test DiffOp base class.
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.
16 * @coversDefaultClass \Drupal\Component\Diff\Engine\DiffOp
20 class DiffOpTest extends TestCase {
23 * DiffOp::reverse() always throws an error.
27 public function testReverse() {
28 if (method_exists($this, 'expectException')) {
29 $this->expectException(Error::class);
32 $this->setExpectedException(\PHPUnit_Framework_Error::class);
35 $result = $op->reverse();