View source
<?php
namespace Drupal\Tests\node\Kernel\Plugin\migrate\source\d6;
use Drupal\Tests\migrate\Kernel\MigrateSqlSourceTestBase;
class ViewModeTest extends MigrateSqlSourceTestBase {
protected static $modules = [
'node',
'user',
'migrate_drupal',
];
public function providerSource() {
$tests = [];
$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,
],
]),
],
];
$tests[0]['expected_data'] = [
[
'entity_type' => 'node',
'view_mode' => '4',
],
[
'entity_type' => 'node',
'view_mode' => 'teaser',
],
[
'entity_type' => 'node',
'view_mode' => 'full',
],
];
return $tests;
}
}