class MigrateCommentStubTest
Same name and namespace in other branches
- 11.x core/modules/comment/tests/src/Kernel/Migrate/MigrateCommentStubTest.php \Drupal\Tests\comment\Kernel\Migrate\MigrateCommentStubTest
- 10 core/modules/comment/tests/src/Kernel/Migrate/MigrateCommentStubTest.php \Drupal\Tests\comment\Kernel\Migrate\MigrateCommentStubTest
- 8.9.x core/modules/comment/tests/src/Kernel/Migrate/MigrateCommentStubTest.php \Drupal\Tests\comment\Kernel\Migrate\MigrateCommentStubTest
Test stub creation for comment entities.
@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\comment\Kernel\Migrate\MigrateCommentStubTest uses \Drupal\migrate_drupal\Tests\StubTestTrait 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 MigrateCommentStubTest
File
-
core/
modules/ comment/ tests/ src/ Kernel/ Migrate/ MigrateCommentStubTest.php, line 15
Namespace
Drupal\Tests\comment\Kernel\MigrateView source
class MigrateCommentStubTest extends MigrateDrupalTestBase {
use StubTestTrait;
/**
* {@inheritdoc}
*/
protected static $modules = [
'comment',
'node',
];
/**
* {@inheritdoc}
*/
protected function setUp() : void {
parent::setUp();
$this->installEntitySchema('comment');
$this->installEntitySchema('node');
$this->installSchema('system', [
'sequences',
]);
// Make sure uid 0 is created (default uid for comments is 0).
$storage = \Drupal::entityTypeManager()->getStorage('user');
// Insert a row for the anonymous user.
$storage->create([
'uid' => 0,
'status' => 0,
'name' => '',
])
->save();
// Need at least one node type and comment type present.
NodeType::create([
'type' => 'testnodetype',
'name' => 'Test node type',
])->save();
CommentType::create([
'id' => 'testcommenttype',
'label' => 'Test comment type',
'target_entity_type_id' => 'node',
])->save();
}
/**
* Tests creation of comment stubs.
*/
public function testStub() {
$this->performStubTest('comment');
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.