CommentEntityTranslationCheckRequirementsTest.php in Drupal 9
File
core/modules/comment/tests/src/Kernel/Migrate/d7/CommentEntityTranslationCheckRequirementsTest.php
View source
<?php
namespace Drupal\Tests\comment\Kernel\Migrate\d7;
use Drupal\Tests\migrate_drupal\Kernel\d7\MigrateDrupal7TestBase;
use Drupal\migrate\Exception\RequirementsException;
class CommentEntityTranslationCheckRequirementsTest extends MigrateDrupal7TestBase {
protected static $modules = [
'content_translation',
'comment',
'language',
];
public function testCheckRequirements($module) {
$this->sourceDatabase
->update('system')
->condition('name', $module)
->fields([
'status' => '0',
])
->execute();
$this
->expectException(RequirementsException::class);
$this
->expectExceptionMessage("The module {$module} is not enabled in the source site");
$this
->getMigration('d7_comment_entity_translation')
->getSourcePlugin()
->checkRequirements();
}
public function providerTestCheckRequirements() {
return [
[
'comment',
],
[
'node',
],
];
}
}