function ViewModeTest::providerSource

Same name in this branch
  1. 11.x core/modules/field/tests/src/Kernel/Plugin/migrate/source/d7/ViewModeTest.php \Drupal\Tests\field\Kernel\Plugin\migrate\source\d7\ViewModeTest::providerSource()
Same name in other branches
  1. 9 core/modules/field/tests/src/Kernel/Plugin/migrate/source/d7/ViewModeTest.php \Drupal\Tests\field\Kernel\Plugin\migrate\source\d7\ViewModeTest::providerSource()
  2. 9 core/modules/node/tests/src/Kernel/Plugin/migrate/source/d6/ViewModeTest.php \Drupal\Tests\node\Kernel\Plugin\migrate\source\d6\ViewModeTest::providerSource()
  3. 8.9.x core/modules/field/tests/src/Kernel/Plugin/migrate/source/d7/ViewModeTest.php \Drupal\Tests\field\Kernel\Plugin\migrate\source\d7\ViewModeTest::providerSource()
  4. 8.9.x core/modules/node/tests/src/Kernel/Plugin/migrate/source/d6/ViewModeTest.php \Drupal\Tests\node\Kernel\Plugin\migrate\source\d6\ViewModeTest::providerSource()
  5. 10 core/modules/field/tests/src/Kernel/Plugin/migrate/source/d7/ViewModeTest.php \Drupal\Tests\field\Kernel\Plugin\migrate\source\d7\ViewModeTest::providerSource()
  6. 10 core/modules/node/tests/src/Kernel/Plugin/migrate/source/d6/ViewModeTest.php \Drupal\Tests\node\Kernel\Plugin\migrate\source\d6\ViewModeTest::providerSource()

File

core/modules/node/tests/src/Kernel/Plugin/migrate/source/d6/ViewModeTest.php, line 26

Class

ViewModeTest
Tests D6 view mode source plugin.

Namespace

Drupal\Tests\node\Kernel\Plugin\migrate\source\d6

Code

public static function providerSource() {
    $tests = [];
    // The source data.
    $tests[0]['source_data']['content_node_field_instance'] = [
        [
            'display_settings' => serialize([
                'weight' => '31',
                'parent' => '',
                'label' => [
                    'format' => 'above',
                ],
                'teaser' => [
                    'format' => 'default',
                    'exclude' => 0,
                ],
                'full' => [
                    'format' => 'default',
                    'exclude' => 0,
                ],
                4 => [
                    'format' => 'default',
                    'exclude' => 0,
                ],
            ]),
        ],
    ];
    // The expected results.
    $tests[0]['expected_data'] = [
        [
            'entity_type' => 'node',
            'view_mode' => '4',
        ],
        [
            'entity_type' => 'node',
            'view_mode' => 'teaser',
        ],
        [
            'entity_type' => 'node',
            'view_mode' => 'full',
        ],
    ];
    return $tests;
}

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