function CommentTypeRequirementsTest::testCheckCommentTypeRequirements
Same name in other branches
- 9 core/modules/comment/tests/src/Kernel/Plugin/migrate/source/CommentTypeRequirementsTest.php \Drupal\Tests\comment\Kernel\Plugin\migrate\source\CommentTypeRequirementsTest::testCheckCommentTypeRequirements()
- 10 core/modules/comment/tests/src/Kernel/Plugin/migrate/source/CommentTypeRequirementsTest.php \Drupal\Tests\comment\Kernel\Plugin\migrate\source\CommentTypeRequirementsTest::testCheckCommentTypeRequirements()
Tests thrown exceptions when node or comment aren't enabled on source.
@dataProvider providerTestCheckCommentTypeRequirements
Parameters
string[] $disabled_source_modules: List of the modules to disable in the source Drupal database.
string $exception_message: The expected message of the RequirementsException.
string $migration_plugin_id: The plugin ID of the comment type migration to test.
File
-
core/
modules/ comment/ tests/ src/ Kernel/ Plugin/ migrate/ source/ CommentTypeRequirementsTest.php, line 34
Class
- CommentTypeRequirementsTest
- Tests check requirements for comment type source plugin.
Namespace
Drupal\Tests\comment\Kernel\Plugin\migrate\sourceCode
public function testCheckCommentTypeRequirements(array $disabled_source_modules, string $exception_message, string $migration_plugin_id) : void {
if (!empty($disabled_source_modules)) {
$this->sourceDatabase
->update('system')
->condition('name', $disabled_source_modules, 'IN')
->fields([
'status' => 0,
])
->execute();
}
$this->expectException(RequirementsException::class);
$this->expectExceptionMessage($exception_message);
$this->getMigration($migration_plugin_id)
->getSourcePlugin()
->checkRequirements();
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.