You are here

public function MigrateCustomBlockTest::testCustomBlockMigration in Zircon Profile 8

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

Tests migration of custom blocks from Drupal 7 to Drupal 8.

File

core/modules/block_content/src/Tests/Migrate/d7/MigrateCustomBlockTest.php, line 46
Contains \Drupal\block_content\Tests\Migrate\d7\MigrateCustomBlockTest.

Class

MigrateCustomBlockTest
Tests migration of custom blocks.

Namespace

Drupal\block_content\Tests\Migrate\d7

Code

public function testCustomBlockMigration() {
  $block = BlockContent::load(1);
  $this
    ->assertTrue($block instanceof BlockContentInterface);

  /** @var \Drupal\block_content\BlockContentInterface $block */
  $this
    ->assertIdentical('Limerick', $block
    ->label());
  $expected_body = "A fellow jumped off a high wall\r\nAnd had a most terrible fall\r\nHe went back to bed\r\nWith a bump on his head\r\nThat's why you don't jump off a wall";
  $this
    ->assertIdentical($expected_body, $block->body->value);
  $this
    ->assertIdentical('filtered_html', $block->body->format);
}