View source
<?php
namespace Drupal\Tests\field\Unit\Plugin\migrate\source\d6;
use Drupal\Tests\migrate\Unit\MigrateSqlSourceTestCase;
class FieldTest extends MigrateSqlSourceTestCase {
const PLUGIN_CLASS = 'Drupal\\field\\Plugin\\migrate\\source\\d6\\Field';
protected $migrationConfiguration = array(
'id' => 'test_field',
'source' => array(
'plugin' => 'd6_field',
),
);
protected $expectedResults = array(
array(
'field_name' => 'field_body',
'type' => 'text',
'global_settings' => '',
'required' => 0,
'multiple' => 0,
'db_storage' => 1,
'module' => 'text',
'db_columns' => '',
'active' => 1,
'locked' => 0,
),
);
protected function setUp() {
$this->expectedResults[0]['global_settings'] = array(
'text_processing' => 0,
'max_length' => '',
'allowed_values' => '',
'allowed_values_php' => '',
);
$this->expectedResults[0]['db_columns'] = array(
'value' => array(
'type' => 'text',
'size' => 'big',
'not null' => '',
'sortable' => 1,
'views' => 1,
),
);
$this->databaseContents['content_node_field'] = $this->expectedResults;
$this->databaseContents['content_node_field'][0]['global_settings'] = serialize($this->databaseContents['content_node_field'][0]['global_settings']);
$this->databaseContents['content_node_field'][0]['db_columns'] = serialize($this->databaseContents['content_node_field'][0]['db_columns']);
$this->databaseContents['content_node_field_instance'][0]['widget_type'] = 'text_textarea';
$this->databaseContents['content_node_field_instance'][0]['field_name'] = 'field_body';
parent::setUp();
}
}