DiffOpTest.php 752 Bytes
Newer Older
1 2 3 4 5
<?php

namespace Drupal\Tests\Component\Diff\Engine;

use Drupal\Component\Diff\Engine\DiffOp;
6
use PHPUnit\Framework\TestCase;
7 8 9 10 11 12 13 14 15 16 17 18

/**
 * Test DiffOp base class.
 *
 * The only significant behavior here is that ::reverse() should throw an error
 * if not overridden. In versions of this code in other projects, reverse() is
 * marked as abstract, which enforces some of this behavior.
 *
 * @coversDefaultClass \Drupal\Component\Diff\Engine\DiffOp
 *
 * @group Diff
 */
19
class DiffOpTest extends TestCase {
20 21 22 23 24 25 26 27 28 29 30 31 32

  /**
   * DiffOp::reverse() always throws an error.
   *
   * @covers ::reverse
   */
  public function testReverse() {
    $this->setExpectedException(\PHPUnit_Framework_Error::class);
    $op = new DiffOp();
    $result = $op->reverse();
  }

}