public function MigrateFieldPluginManagerTest::testDefaultWeight in Drupal 8
Same name and namespace in other branches
- 9 core/modules/migrate_drupal/tests/src/Kernel/MigrateFieldPluginManagerTest.php \Drupal\Tests\migrate_drupal\Kernel\MigrateFieldPluginManagerTest::testDefaultWeight()
Tests that plugins with no explicit weight are given a weight of 0.
File
- core/
modules/ migrate_drupal/ tests/ src/ Kernel/ MigrateFieldPluginManagerTest.php, line 125
Class
- MigrateFieldPluginManagerTest
- Tests the field plugin manager.
Namespace
Drupal\Tests\migrate_drupal\KernelCode
public function testDefaultWeight() {
$definitions = $this->pluginManager
->getDefinitions();
$deprecated_plugins = [
'date',
];
foreach ($definitions as $id => $definition) {
$this
->assertArrayHasKey('weight', $definition);
if (in_array($id, $deprecated_plugins, TRUE)) {
$this
->assertSame(9999999, $definition['weight']);
}
else {
$this
->assertSame(0, $definition['weight']);
}
}
}