function DiffOpOutputBuilderTest::testGetDiff

Same name and namespace in other branches
  1. 11.x core/tests/Drupal/Tests/Component/Diff/DiffOpOutputBuilderTest.php \Drupal\Tests\Component\Diff\DiffOpOutputBuilderTest::testGetDiff()
  2. 10 core/tests/Drupal/Tests/Component/Diff/DiffOpOutputBuilderTest.php \Drupal\Tests\Component\Diff\DiffOpOutputBuilderTest::testGetDiff()

Tests get diff.

Attributes

#[DataProvider('provideTestDiff')]

File

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

Class

DiffOpOutputBuilderTest
Tests Drupal\Component\Diff\DiffOpOutputBuilder.

Namespace

Drupal\Tests\Component\Diff

Code

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

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