function HWLDFWordAccumulatorTest::provideAddWords

Same name in other branches
  1. 9 core/tests/Drupal/Tests/Component/Diff/Engine/HWLDFWordAccumulatorTest.php \Drupal\Tests\Component\Diff\Engine\HWLDFWordAccumulatorTest::provideAddWords()
  2. 8.9.x core/tests/Drupal/Tests/Component/Diff/Engine/HWLDFWordAccumulatorTest.php \Drupal\Tests\Component\Diff\Engine\HWLDFWordAccumulatorTest::provideAddWords()
  3. 10 core/tests/Drupal/Tests/Component/Diff/Engine/HWLDFWordAccumulatorTest.php \Drupal\Tests\Component\Diff\Engine\HWLDFWordAccumulatorTest::provideAddWords()

Return value

array

  • Expected array of lines from getLines().
  • Array of strings for the $words parameter to addWords().
  • String tag for the $tag parameter to addWords().

File

core/tests/Drupal/Tests/Component/Diff/Engine/HWLDFWordAccumulatorTest.php, line 41

Class

HWLDFWordAccumulatorTest
Test HWLDFWordAccumulator.

Namespace

Drupal\Tests\Component\Diff\Engine

Code

public static function provideAddWords() {
    return [
        [
            [
                'wordword2',
            ],
            [
                'word',
                'word2',
            ],
            'tag',
        ],
        [
            [
                'word',
                'word2',
            ],
            [
                'word',
                "\nword2",
            ],
            'tag',
        ],
        [
            [
                ' ',
                'word2',
            ],
            [
                '',
                "\nword2",
            ],
            'tag',
        ],
    ];
}

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