class MigrateBlockContentStubTest
Same name and namespace in other branches
- 11.x core/modules/block_content/tests/src/Kernel/Migrate/MigrateBlockContentStubTest.php \Drupal\Tests\block_content\Kernel\Migrate\MigrateBlockContentStubTest
- 10 core/modules/block_content/tests/src/Kernel/Migrate/MigrateBlockContentStubTest.php \Drupal\Tests\block_content\Kernel\Migrate\MigrateBlockContentStubTest
- 8.9.x core/modules/block_content/tests/src/Kernel/Migrate/MigrateBlockContentStubTest.php \Drupal\Tests\block_content\Kernel\Migrate\MigrateBlockContentStubTest
Test stub creation for block_content entities.
@group block_content
Hierarchy
- class \Drupal\KernelTests\KernelTestBase implements \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 extends \PHPUnit\Framework\TestCase
- class \Drupal\Tests\migrate\Kernel\MigrateTestBase implements \Drupal\migrate\MigrateMessageInterface extends \Drupal\KernelTests\KernelTestBase
- class \Drupal\Tests\migrate_drupal\Kernel\MigrateDrupalTestBase extends \Drupal\Tests\migrate\Kernel\MigrateTestBase
- class \Drupal\Tests\block_content\Kernel\Migrate\MigrateBlockContentStubTest uses \Drupal\migrate_drupal\Tests\StubTestTrait extends \Drupal\Tests\migrate_drupal\Kernel\MigrateDrupalTestBase
- class \Drupal\Tests\migrate_drupal\Kernel\MigrateDrupalTestBase extends \Drupal\Tests\migrate\Kernel\MigrateTestBase
- class \Drupal\Tests\migrate\Kernel\MigrateTestBase implements \Drupal\migrate\MigrateMessageInterface extends \Drupal\KernelTests\KernelTestBase
Expanded class hierarchy of MigrateBlockContentStubTest
File
-
core/
modules/ block_content/ tests/ src/ Kernel/ Migrate/ MigrateBlockContentStubTest.php, line 15
Namespace
Drupal\Tests\block_content\Kernel\MigrateView source
class MigrateBlockContentStubTest extends MigrateDrupalTestBase {
use StubTestTrait;
/**
* {@inheritdoc}
*/
protected static $modules = [
'block_content',
];
/**
* {@inheritdoc}
*/
protected function setUp() : void {
parent::setUp();
$this->installEntitySchema('block_content');
}
/**
* Tests creation of block content stubs with no block_content_type available.
*/
public function testStubFailure() {
// Expected MigrateException thrown when no bundles exist.
$this->expectException(MigrateException::class);
$this->expectExceptionMessage('Stubbing failed, no bundles available for entity type: block_content');
$this->createEntityStub('block_content');
}
/**
* Tests creation of block content stubs when there is a block_content_type.
*/
public function testStubSuccess() {
BlockContentType::create([
'id' => 'test_block_content_type',
'label' => 'Test block content type',
])->save();
$this->performStubTest('block_content');
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.