View source
<?php
namespace Drupal\Tests\node\Unit\Plugin\migrate\source\d6;
use Drupal\Tests\migrate\Unit\MigrateSqlSourceTestCase;
class ViewModeTest extends MigrateSqlSourceTestCase {
const PLUGIN_CLASS = 'Drupal\\node\\Plugin\\migrate\\source\\d6\\ViewMode';
protected $migrationConfiguration = array(
'id' => 'view_mode_test',
'source' => array(
'plugin' => 'd6_field_instance_view_mode',
),
);
protected $expectedResults = array(
array(
'entity_type' => 'node',
'view_mode' => '4',
),
array(
'entity_type' => 'node',
'view_mode' => 'teaser',
),
array(
'entity_type' => 'node',
'view_mode' => 'full',
),
);
protected function setUp() {
$this->databaseContents['content_node_field_instance'][] = array(
'display_settings' => serialize(array(
'weight' => '31',
'parent' => '',
'label' => array(
'format' => 'above',
),
'teaser' => array(
'format' => 'default',
'exclude' => 0,
),
'full' => array(
'format' => 'default',
'exclude' => 0,
),
4 => array(
'format' => 'default',
'exclude' => 0,
),
)),
);
parent::setUp();
}
}