reverse example


        $instance = static::createFromString('foobar');

        self::assertSame('foobar', $instance->toString());
    }

    /** * @dataProvider provideReverse */
    public function testReverse(string $expected, string $origin)
    {
        $instance = static::createFromString($origin)->reverse();

        $this->assertEquals(static::createFromString($expected)$instance);
    }

    public static function provideReverse()
    {
        return [
            ['', ''],
            ['oof', 'foo'],
            ["\n!!!\tTAERG SI ynofmyS ", " Symfony IS GREAT\t!!!\n"],
        ];
    }

  public function reverse() {
    @trigger_error(__METHOD__ . '() is deprecated in drupal:10.1.0 and is removed from drupal:11.0.0. There is no replacement. See https://www.drupal.org/node/3337942', E_USER_DEPRECATED);
    $rev = $this;
    $rev->edits = [];
    foreach ($this->edits as $edit) {
      $rev->edits[] = $edit->reverse();
    }
    return $rev;
  }

  /** * Check for empty diff. * * @return bool True iff two sequences were identical. * * @deprecated in drupal:10.1.0 and is removed from drupal:11.0.0. There is no * replacement. * * @see https://www.drupal.org/node/3337942 */

    function reverse()
    {
        if (version_compare(zend_version(), '2', '>')) {
            $rev = clone($this);
        } else {
            $rev = $this;
        }
        $rev->_edits = array();
        foreach ($this->_edits as $edit) {
            $rev->_edits[] = $edit->reverse();
        }
        return $rev;
    }

    /** * Checks for an empty diff. * * @return bool True if two sequences were identical. */
    function isEmpty()
    {
        
use PhpUnitWarnings;

  /** * DiffOp::reverse() always throws an error. * * @covers ::reverse */
  public function testReverse() {
    $this->expectDeprecation('Drupal\Component\Diff\Engine\DiffOp::reverse() is deprecated in drupal:10.1.0 and is removed from drupal:11.0.0. There is no replacement. See https://www.drupal.org/node/3337942');
    $this->expectError();
    $op = new DiffOp();
    $result = $op->reverse();
  }

}
Home | Imprint | This part of the site doesn't use cookies.