function DiffEngineTest::provideTestDiff

Same name in other branches
  1. 9 core/tests/Drupal/Tests/Component/Diff/Engine/DiffEngineTest.php \Drupal\Tests\Component\Diff\Engine\DiffEngineTest::provideTestDiff()
  2. 10 core/tests/Drupal/Tests/Component/Diff/Engine/DiffEngineTest.php \Drupal\Tests\Component\Diff\Engine\DiffEngineTest::provideTestDiff()

Return value

array

  • Expected output in terms of return class. A list of class names expected to be returned by DiffEngine::diff().
  • An array of strings to change from.
  • An array of strings to change to.

File

core/tests/Drupal/Tests/Component/Diff/Engine/DiffEngineTest.php, line 28

Class

DiffEngineTest
Test DiffEngine class.

Namespace

Drupal\Tests\Component\Diff\Engine

Code

public function provideTestDiff() {
    return [
        'empty' => [
            [],
            [],
            [],
        ],
        'add' => [
            [
                DiffOpAdd::class,
            ],
            [],
            [
                'a',
            ],
        ],
        'copy' => [
            [
                DiffOpCopy::class,
            ],
            [
                'a',
            ],
            [
                'a',
            ],
        ],
        'change' => [
            [
                DiffOpChange::class,
            ],
            [
                'a',
            ],
            [
                'b',
            ],
        ],
        'copy-and-change' => [
            [
                DiffOpCopy::class,
                DiffOpChange::class,
            ],
            [
                'a',
                'b',
            ],
            [
                'a',
                'c',
            ],
        ],
        'copy-change-copy' => [
            [
                DiffOpCopy::class,
                DiffOpChange::class,
                DiffOpCopy::class,
            ],
            [
                'a',
                'b',
                'd',
            ],
            [
                'a',
                'c',
                'd',
            ],
        ],
        'copy-change-copy-add' => [
            [
                DiffOpCopy::class,
                DiffOpChange::class,
                DiffOpCopy::class,
                DiffOpAdd::class,
            ],
            [
                'a',
                'b',
                'd',
            ],
            [
                'a',
                'c',
                'd',
                'e',
            ],
        ],
        'copy-delete' => [
            [
                DiffOpCopy::class,
                DiffOpDelete::class,
            ],
            [
                'a',
                'b',
                'd',
            ],
            [
                'a',
            ],
        ],
    ];
}

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