function DiffOpOutputBuilderTest::testToOpsArray

Same name in other branches
  1. 11.x core/tests/Drupal/Tests/Component/Diff/DiffOpOutputBuilderTest.php \Drupal\Tests\Component\Diff\DiffOpOutputBuilderTest::testToOpsArray()

Tests whether op classes returned match expectations.

@covers ::toOpsArray @dataProvider provideTestDiff

File

core/tests/Drupal/Tests/Component/Diff/DiffOpOutputBuilderTest.php, line 97

Class

DiffOpOutputBuilderTest
@coversDefaultClass \Drupal\Component\Diff\DiffOpOutputBuilder

Namespace

Drupal\Tests\Component\Diff

Code

public function testToOpsArray(array $expected, array $from, array $to) : void {
    $diffOpBuilder = new DiffOpOutputBuilder();
    $differ = new Differ($diffOpBuilder);
    $diff = $differ->diffToArray($from, $to);
    $this->assertEquals($expected, $diffOpBuilder->toOpsArray($diff));
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.