TextFieldTest.php
Same filename in this branch
- 9 core/modules/text/tests/src/Unit/Migrate/d6/TextFieldTest.php
- 9 core/modules/text/tests/src/Unit/Migrate/d7/TextFieldTest.php
- 9 core/modules/text/tests/src/Unit/Plugin/migrate/field/d6/TextFieldTest.php
- 9 core/modules/text/tests/src/Functional/TextFieldTest.php
- 9 core/tests/Drupal/Tests/Core/Render/Element/TextfieldTest.php
Same filename in other branches
- 8.9.x core/modules/text/tests/src/Unit/Migrate/d6/TextFieldTest.php
- 8.9.x core/modules/text/tests/src/Unit/Migrate/d7/TextFieldTest.php
- 8.9.x core/modules/text/tests/src/Unit/Plugin/migrate/field/d6/TextFieldTest.php
- 8.9.x core/modules/text/tests/src/Unit/Plugin/migrate/field/d7/TextFieldTest.php
- 8.9.x core/modules/text/tests/src/Functional/TextFieldTest.php
- 8.9.x core/tests/Drupal/Tests/Core/Render/Element/TextfieldTest.php
- 10 core/modules/text/tests/src/Unit/Plugin/migrate/field/d6/TextFieldTest.php
- 10 core/modules/text/tests/src/Unit/Plugin/migrate/field/d7/TextFieldTest.php
- 10 core/modules/text/tests/src/Functional/TextFieldTest.php
- 10 core/tests/Drupal/Tests/Core/Render/Element/TextfieldTest.php
- 11.x core/modules/text/tests/src/Unit/Plugin/migrate/field/d6/TextFieldTest.php
- 11.x core/modules/text/tests/src/Unit/Plugin/migrate/field/d7/TextFieldTest.php
- 11.x core/modules/text/tests/src/Functional/TextFieldTest.php
- 11.x core/tests/Drupal/Tests/Core/Render/Element/TextfieldTest.php
Namespace
Drupal\Tests\text\Unit\Plugin\migrate\field\d7File
-
core/
modules/ text/ tests/ src/ Unit/ Plugin/ migrate/ field/ d7/ TextFieldTest.php
View source
<?php
namespace Drupal\Tests\text\Unit\Plugin\migrate\field\d7;
use Drupal\migrate\Row;
use Drupal\Tests\UnitTestCase;
use Drupal\text\Plugin\migrate\field\d7\TextField;
/**
* @coversDefaultClass \Drupal\text\Plugin\migrate\field\d7\TextField
* @group text
*/
class TextFieldTest extends UnitTestCase {
/**
* @var \Drupal\migrate_drupal\Plugin\MigrateFieldInterface
*/
protected $plugin;
/**
* {@inheritdoc}
*/
protected function setUp() : void {
$this->plugin = new TextField([], 'text', []);
}
/**
* Data provider for testGetFieldFormatterType().
*/
public function getFieldFormatterTypeProvider() {
return [
[
'text',
'text_plain',
'string',
],
[
'text_long',
'text_default',
'basic_string',
],
[
'text_long',
'text_plain',
'basic_string',
],
];
}
/**
* @covers ::getFieldFormatterType
* @covers ::getFieldType
* @dataProvider getFieldFormatterTypeProvider
*/
public function testGetFieldFormatterType($type, $formatter_type, $expected) {
$row = new Row();
$row->setSourceProperty('type', $type);
$row->setSourceProperty('formatter/type', $formatter_type);
$row->setSourceProperty('instances', [
[
'data' => serialize([
'settings' => [
'text_processing' => '0',
],
]),
],
]);
$this->assertEquals($expected, $this->plugin
->getFieldFormatterType($row));
}
}
Classes
Title | Deprecated | Summary |
---|---|---|
TextFieldTest | @coversDefaultClass \Drupal\text\Plugin\migrate\field\d7\TextField @group text |
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.