class MigrateStatusTest in Drupal 10
Same name and namespace in other branches
- 8 core/modules/migrate/tests/src/Kernel/MigrateStatusTest.php \Drupal\Tests\migrate\Kernel\MigrateStatusTest
- 9 core/modules/migrate/tests/src/Kernel/MigrateStatusTest.php \Drupal\Tests\migrate\Kernel\MigrateStatusTest
Tests migration status tracking.
@group migrate
Hierarchy
- class \Drupal\KernelTests\KernelTestBase extends \PHPUnit\Framework\TestCase implements ServiceProviderInterface uses \Drupal\Tests\PhpUnitCompatibilityTrait, \Symfony\Bridge\PhpUnit\ExpectDeprecationTrait, AssertContentTrait, ConfigTestTrait, ExtensionListTestTrait, RandomGeneratorTrait, TestRequirementsTrait, PhpUnitWarnings
- class \Drupal\Tests\migrate\Kernel\MigrateTestBase implements MigrateMessageInterface
- class \Drupal\Tests\migrate\Kernel\MigrateStatusTest
- class \Drupal\Tests\migrate\Kernel\MigrateTestBase implements MigrateMessageInterface
Expanded class hierarchy of MigrateStatusTest
File
- core/
modules/ migrate/ tests/ src/ Kernel/ MigrateStatusTest.php, line 12
Namespace
Drupal\Tests\migrate\KernelView source
class MigrateStatusTest extends MigrateTestBase {
/**
* Tests different connection types.
*/
public function testStatus() {
// Create a minimally valid migration.
$definition = [
'id' => 'migrate_status_test',
'migration_tags' => [
'Testing',
],
'source' => [
'plugin' => 'empty',
],
'destination' => [
'plugin' => 'config',
'config_name' => 'migrate_test.settings',
],
'process' => [
'foo' => 'bar',
],
];
$migration = \Drupal::service('plugin.manager.migration')
->createStubMigration($definition);
// Default status is idle.
$status = $migration
->getStatus();
$this
->assertSame(MigrationInterface::STATUS_IDLE, $status);
// Test setting and retrieving all known status values.
$status_list = [
MigrationInterface::STATUS_IDLE,
MigrationInterface::STATUS_IMPORTING,
MigrationInterface::STATUS_ROLLING_BACK,
MigrationInterface::STATUS_STOPPING,
MigrationInterface::STATUS_DISABLED,
];
foreach ($status_list as $status) {
$migration
->setStatus($status);
$this
->assertSame($status, $migration
->getStatus());
}
}
}