You are here

public function MigrateBlockContentStubTest::testStubFailure in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/block_content/src/Tests/Migrate/MigrateBlockContentStubTest.php \Drupal\block_content\Tests\Migrate\MigrateBlockContentStubTest::testStubFailure()

Tests creation of block content stubs with no block_content_type available.

File

core/modules/block_content/src/Tests/Migrate/MigrateBlockContentStubTest.php, line 40
Contains \Drupal\block_content\Tests\Migrate\MigrateBlockContentStubTest.

Class

MigrateBlockContentStubTest
Test stub creation for block_content entities.

Namespace

Drupal\block_content\Tests\Migrate

Code

public function testStubFailure() {
  $message = 'Expected MigrateException thrown when no bundles exist.';
  try {
    $this
      ->createStub('block_content');
    $this
      ->fail($message);
  } catch (MigrateException $e) {
    $this
      ->pass($message);
    $this
      ->assertEqual('Stubbing failed, no bundles available for entity type: block_content', $e
      ->getMessage());
  }
}