class FieldGroupTest in Field Group 8
Same name and namespace in other branches
- 8.3 contrib/field_group_migrate/tests/src/Unit/Migrate/d7/FieldGroupTest.php \Drupal\Tests\field_group_migrate\Unit\Migrate\d7\FieldGroupTest
Tests D7 field group source plugin.
@group field_group
Hierarchy
- class \Drupal\Tests\UnitTestCase extends \PHPUnit\Framework\TestCase uses PhpunitCompatibilityTrait
- class \Drupal\Tests\migrate\Unit\MigrateTestCase
- class \Drupal\Tests\migrate\Unit\MigrateSqlSourceTestCase
- class \Drupal\Tests\field_group_migrate\Unit\Migrate\d7\FieldGroupTest
- class \Drupal\Tests\migrate\Unit\MigrateSqlSourceTestCase
- class \Drupal\Tests\migrate\Unit\MigrateTestCase
Expanded class hierarchy of FieldGroupTest
File
- contrib/
field_group_migrate/ tests/ src/ Unit/ Migrate/ d7/ FieldGroupTest.php, line 12
Namespace
Drupal\Tests\field_group_migrate\Unit\Migrate\d7View source
class FieldGroupTest extends MigrateSqlSourceTestCase {
const PLUGIN_CLASS = 'Drupal\\field_group_migrate\\Plugin\\migrate\\source\\d7\\FieldGroup';
protected $migrationConfiguration = [
'id' => 'test',
'source' => [
'plugin' => 'd7_field_group',
],
];
protected $expectedResults = [
[
'id' => '1',
'identifier' => 'group_page|node|page|default',
'group_name' => 'group_page',
'entity_type' => 'node',
'bundle' => 'page',
'mode' => 'default',
'parent_name' => '',
'data' => 'a:5:{s:5:"label";s:10:"Node group";s:6:"weight";i:0;s:8:"children";a:0:{}s:11:"format_type";s:5:"htabs";s:15:"format_settings";a:1:{s:17:"instance_settings";a:0:{}}}',
],
[
'id' => '2',
'identifier' => 'group_user|user|user|default',
'group_name' => 'group_user',
'entity_type' => 'user',
'bundle' => 'user',
'mode' => 'default',
'parent_name' => '',
'data' => 'a:5:{s:5:"label";s:17:"User group parent";s:6:"weight";i:1;s:8:"children";a:0:{}s:11:"format_type";s:3:"div";s:15:"format_settings";a:1:{s:17:"instance_settings";a:0:{}}}',
],
[
'id' => '3',
'identifier' => 'group_user_child|user|user|default',
'group_name' => 'group_user_child',
'entity_type' => 'user',
'bundle' => 'user',
'mode' => 'default',
'parent_name' => 'group_user',
'data' => 'a:5:{s:5:"label";s:16:"User group child";s:6:"weight";i:99;s:8:"children";a:1:{i:0;s:12:"user_picture";}s:11:"format_type";s:4:"tabs";s:15:"format_settings";a:2:{s:5:"label";s:16:"User group child";s:17:"instance_settings";a:2:{s:7:"classes";s:16:"user-group-child";s:2:"id";s:33:"group_article_node_article_teaser";}}}',
],
[
'id' => '4',
'identifier' => 'group_article|node|article|teaser',
'group_name' => 'group_article',
'entity_type' => 'node',
'bundle' => 'article',
'mode' => 'teaser',
'parent_name' => '',
'data' => 'a:5:{s:5:"label";s:10:"htab group";s:6:"weight";i:2;s:8:"children";a:1:{i:0;s:11:"field_image";}s:11:"format_type";s:4:"htab";s:15:"format_settings";a:1:{s:17:"instance_settings";a:1:{s:7:"classes";s:10:"htab-group";}}}',
],
[
'id' => '5',
'identifier' => 'group_page|node|page|form',
'group_name' => 'group_page',
'entity_type' => 'node',
'bundle' => 'page',
'mode' => 'form',
'parent_name' => '',
'data' => 'a:5:{s:5:"label";s:15:"Node form group";s:6:"weight";i:0;s:8:"children";a:0:{}s:11:"format_type";s:5:"htabs";s:15:"format_settings";a:1:{s:17:"instance_settings";a:0:{}}}',
],
[
'id' => '6',
'identifier' => 'group_article|node|article|form',
'group_name' => 'group_article',
'entity_type' => 'node',
'bundle' => 'article',
'mode' => 'form',
'parent_name' => '',
'data' => 'a:5:{s:5:"label";s:15:"htab form group";s:6:"weight";i:2;s:8:"children";a:1:{i:0;s:11:"field_image";}s:11:"format_type";s:4:"htab";s:15:"format_settings";a:1:{s:17:"instance_settings";a:0:{}}}',
],
];
/**
* {@inheritdoc}
*/
protected function setUp() {
$this->databaseContents['field_group'] = $this->expectedResults;
parent::setUp();
}
/**
* {@inheritdoc}
*/
public function providerSource() {
// @TODO FIX.
return [];
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
FieldGroupTest:: |
protected | property |
Expected results after the source parsing. Overrides MigrateSqlSourceTestCase:: |
|
FieldGroupTest:: |
protected | property |
An array of migration configuration values. Overrides MigrateTestCase:: |
|
FieldGroupTest:: |
constant |
The plugin class under test. Overrides MigrateSqlSourceTestCase:: |
||
FieldGroupTest:: |
public | function | ||
FieldGroupTest:: |
protected | function |
Overrides MigrateSqlSourceTestCase:: |
|
MigrateSqlSourceTestCase:: |
protected | property | The database contents. | 4 |
MigrateSqlSourceTestCase:: |
protected | property | Expected count of source rows. | |
MigrateSqlSourceTestCase:: |
protected | property | The source plugin instance under test. | |
MigrateSqlSourceTestCase:: |
protected | property | The tested source plugin. | |
MigrateSqlSourceTestCase:: |
protected | function |
Gets the value on a row for a given key. Overrides MigrateTestCase:: |
|
MigrateSqlSourceTestCase:: |
constant | The high water mark at the beginning of the import operation. | ||
MigrateSqlSourceTestCase:: |
public | function | Tests that the source returns the same rows as expected. | |
MigrateSqlSourceTestCase:: |
public | function | Tests that the source returns the row count expected. | |
MigrateSqlSourceTestCase:: |
public | function | Tests the source defines a valid ID. | |
MigrateTestCase:: |
protected | property | The migration ID map. | |
MigrateTestCase:: |
protected | property | Local store for mocking setStatus()/getStatus(). | |
MigrateTestCase:: |
protected | function | Generates a table schema from a row. | |
MigrateTestCase:: |
protected | function | Gets an SQLite database connection object for use in tests. | |
MigrateTestCase:: |
protected | function | Retrieves a mocked migration. | 1 |
MigrateTestCase:: |
public | function | Tests a query. | |
MigrateTestCase:: |
protected | function | Asserts tested values during test retrieval. | |
PhpunitCompatibilityTrait:: |
public | function | Returns a mock object for the specified class using the available method. | |
PhpunitCompatibilityTrait:: |
public | function | Compatibility layer for PHPUnit 6 to support PHPUnit 4 code. | |
UnitTestCase:: |
protected | property | The random generator. | |
UnitTestCase:: |
protected | property | The app root. | 1 |
UnitTestCase:: |
protected | function | Asserts if two arrays are equal by sorting them first. | |
UnitTestCase:: |
protected | function | Mocks a block with a block plugin. | 1 |
UnitTestCase:: |
protected | function | Returns a stub class resolver. | |
UnitTestCase:: |
public | function | Returns a stub config factory that behaves according to the passed array. | |
UnitTestCase:: |
public | function | Returns a stub config storage that returns the supplied configuration. | |
UnitTestCase:: |
protected | function | Sets up a container with a cache tags invalidator. | |
UnitTestCase:: |
protected | function | Gets the random generator for the utility methods. | |
UnitTestCase:: |
public | function | Returns a stub translation manager that just returns the passed string. | |
UnitTestCase:: |
public | function | Generates a unique random string containing letters and numbers. |