Update to Drupal 8.0.0-rc3. For more information, see https://www.drupal.org/node/2608078
This commit is contained in:
parent
6419a031d7
commit
4afb23bbd3
762 changed files with 20080 additions and 6368 deletions
|
@ -8,6 +8,7 @@
|
|||
namespace Drupal\Tests\text\Unit\Migrate;
|
||||
|
||||
use Drupal\migrate\Entity\MigrationInterface;
|
||||
use Drupal\migrate\Row;
|
||||
use Drupal\Tests\UnitTestCase;
|
||||
use Drupal\text\Plugin\migrate\cckfield\TextField;
|
||||
use Prophecy\Argument;
|
||||
|
@ -121,4 +122,49 @@ class TextFieldTest extends UnitTestCase {
|
|||
$this->assertSame($expected, $this->migration->getProcess()['process']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Data provider for testGetFieldType().
|
||||
*/
|
||||
public function getFieldTypeProvider() {
|
||||
return array(
|
||||
array('string_long', 'text_textfield', array(
|
||||
'text_processing' => FALSE,
|
||||
)),
|
||||
array('string', 'text_textfield', array(
|
||||
'text_processing' => FALSE,
|
||||
'max_length' => 128,
|
||||
)),
|
||||
array('string_long', 'text_textfield', array(
|
||||
'text_processing' => FALSE,
|
||||
'max_length' => 4096,
|
||||
)),
|
||||
array('text_long', 'text_textfield', array(
|
||||
'text_processing' => TRUE,
|
||||
)),
|
||||
array('text', 'text_textfield', array(
|
||||
'text_processing' => TRUE,
|
||||
'max_length' => 128,
|
||||
)),
|
||||
array('text_long', 'text_textfield', array(
|
||||
'text_processing' => TRUE,
|
||||
'max_length' => 4096,
|
||||
)),
|
||||
array('list_string', 'optionwidgets_buttons'),
|
||||
array('list_string', 'optionwidgets_select'),
|
||||
array('boolean', 'optionwidgets_onoff'),
|
||||
array('text_long', 'text_textarea'),
|
||||
array(NULL, 'undefined'),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers ::getFieldType
|
||||
* @dataProvider getFieldTypeProvider
|
||||
*/
|
||||
public function testGetFieldType($expected_type, $widget_type, array $settings = array()) {
|
||||
$row = new Row(array('widget_type' => $widget_type), array('widget_type' => array()));
|
||||
$row->setSourceProperty('global_settings', $settings);
|
||||
$this->assertSame($expected_type, $this->plugin->getFieldType($row));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Reference in a new issue