class CommentEntityTranslationCheckRequirementsTest
Same name and namespace in other branches
- 11.x core/modules/comment/tests/src/Kernel/Migrate/d7/CommentEntityTranslationCheckRequirementsTest.php \Drupal\Tests\comment\Kernel\Migrate\d7\CommentEntityTranslationCheckRequirementsTest
Tests check requirements for comment entity translation source plugin.
@group comment
Hierarchy
- class \Drupal\KernelTests\KernelTestBase extends \Drupal\Core\DependencyInjection\ServiceProviderInterface uses \Drupal\KernelTests\AssertLegacyTrait, \Drupal\KernelTests\AssertContentTrait, \Drupal\Tests\RandomGeneratorTrait, \Drupal\Tests\ConfigTestTrait, \Drupal\Tests\ExtensionListTestTrait, \Drupal\Tests\TestRequirementsTrait, \Drupal\Tests\Traits\PhpUnitWarnings, \Drupal\Tests\PhpUnitCompatibilityTrait, \Symfony\Bridge\PhpUnit\ExpectDeprecationTrait implements \PHPUnit\Framework\TestCase
- class \Drupal\Tests\migrate\Kernel\MigrateTestBase extends \Drupal\migrate\MigrateMessageInterface implements \Drupal\KernelTests\KernelTestBase
- class \Drupal\Tests\migrate_drupal\Kernel\MigrateDrupalTestBase implements \Drupal\Tests\migrate\Kernel\MigrateTestBase
- class \Drupal\Tests\migrate_drupal\Kernel\d7\MigrateDrupal7TestBase uses \Drupal\Tests\migrate_drupal\Traits\NodeMigrateTypeTestTrait implements \Drupal\Tests\migrate_drupal\Kernel\MigrateDrupalTestBase
- class \Drupal\Tests\comment\Kernel\Migrate\d7\CommentEntityTranslationCheckRequirementsTest implements \Drupal\Tests\migrate_drupal\Kernel\d7\MigrateDrupal7TestBase
- class \Drupal\Tests\migrate_drupal\Kernel\d7\MigrateDrupal7TestBase uses \Drupal\Tests\migrate_drupal\Traits\NodeMigrateTypeTestTrait implements \Drupal\Tests\migrate_drupal\Kernel\MigrateDrupalTestBase
- class \Drupal\Tests\migrate_drupal\Kernel\MigrateDrupalTestBase implements \Drupal\Tests\migrate\Kernel\MigrateTestBase
- class \Drupal\Tests\migrate\Kernel\MigrateTestBase extends \Drupal\migrate\MigrateMessageInterface implements \Drupal\KernelTests\KernelTestBase
Expanded class hierarchy of CommentEntityTranslationCheckRequirementsTest
File
-
core/
modules/ comment/ tests/ src/ Kernel/ Migrate/ d7/ CommentEntityTranslationCheckRequirementsTest.php, line 13
Namespace
Drupal\Tests\comment\Kernel\Migrate\d7View source
class CommentEntityTranslationCheckRequirementsTest extends MigrateDrupal7TestBase {
/**
* {@inheritdoc}
*/
protected static $modules = [
'content_translation',
'comment',
'language',
];
/**
* Tests exception thrown when the given module is not enabled in the source.
*
* @dataProvider providerTestCheckRequirements
*/
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();
}
/**
* Provides data for testCheckRequirements.
*
* @return string[][]
*/
public function providerTestCheckRequirements() {
return [
[
'comment',
],
[
'node',
],
];
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.