public function CommentEntityTranslationCheckRequirementsTest::testCheckRequirements in Drupal 9
Tests exception thrown when the given module is not enabled in the source.
@dataProvider providerTestCheckRequirements
File
- core/
modules/ comment/ tests/ src/ Kernel/ Migrate/ d7/ CommentEntityTranslationCheckRequirementsTest.php, line 29
Class
- CommentEntityTranslationCheckRequirementsTest
- Tests check requirements for comment entity translation source plugin.
Namespace
Drupal\Tests\comment\Kernel\Migrate\d7Code
public function testCheckRequirements($module) {
// Disable the module in the source site.
$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();
}