
| Current Path : /var/www/html1/bbp/web/modules/contrib/migrate_tools/tests/src/Functional/ |
Linux ift1.ift-informatik.de 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64 |
| Current File : /var/www/html1/bbp/web/modules/contrib/migrate_tools/tests/src/Functional/DrushBatchImportTest.php |
<?php
namespace Drupal\Tests\migrate_tools\Functional;
use Drupal\Tests\BrowserTestBase;
use Drush\TestTraits\DrushTestTrait;
/**
* Test that batch import runs correctly in drush command.
*
* @group migrate_tools
*/
class DrushBatchImportTest extends BrowserTestBase {
use DrushTestTrait;
/**
* {@inheritdoc}
*/
protected $defaultTheme = 'stark';
/**
* {@inheritdoc}
*/
protected static $modules = [
'migrate_tools_test',
'migrate_tools',
'migrate_plus',
'taxonomy',
'text',
'system',
'user',
];
/**
* Tests that a batch import run from a custom drush command succeeds.
*/
public function testBatchImportInDrushComand(): void {
$this->drush('migrate:batch-import-fruit');
$migration = \Drupal::service('plugin.manager.migration')->createInstance('fruit_terms');
$id_map = $migration->getIdMap();
$this->assertSame(3, $id_map->importedCount());
}
}