diff --git a/core/modules/content_translation/tests/src/Kernel/Migrate/d6/MigrateCustomBlockContentTranslationMissingTest.php b/core/modules/content_translation/tests/src/Kernel/Migrate/d6/MigrateCustomBlockContentTranslationMissingTest.php index 9f8580b..b40c88c 100644 --- a/core/modules/content_translation/tests/src/Kernel/Migrate/d6/MigrateCustomBlockContentTranslationMissingTest.php +++ b/core/modules/content_translation/tests/src/Kernel/Migrate/d6/MigrateCustomBlockContentTranslationMissingTest.php @@ -2,7 +2,7 @@ namespace Drupal\Tests\content_translation\Kernel\Migrate\d6; -use Drupal\migrate\MigrateException; +use Drupal\Component\Render\FormattableMarkup; use Drupal\Tests\migrate_drupal\Kernel\d6\MigrateDrupal6TestBase; /** @@ -22,15 +22,16 @@ class MigrateCustomBlockContentTranslationMissingTest extends MigrateDrupal6Test ]; /** - * {@inheritdoc} + * Tests the Drupal 6 i18n custom block strings to Drupal 8 migration when the + * source translation tables are missing. */ - protected function setUp() { - parent::setUp(); + public function testCustomBlockContentTranslation() { $this->installConfig(['block_content']); $this->installEntitySchema('block_content'); // Remove tables required for the migrating translations. $this->sourceDatabase->schema()->dropTable('i18n_strings'); $this->sourceDatabase->schema()->dropTable('locales_target'); + $this->startCollectingMessages(); $this->executeMigrations([ 'language', 'd6_filter_format', @@ -39,14 +40,8 @@ protected function setUp() { 'd6_custom_block', 'd6_custom_block_translation', ]); - } - - /** - * Tests the Drupal 6 i18n custom block strings to Drupal 8 migration when the - * source translation tables are missing. - */ - public function testCustomBlockContentTranslation() { - $this->setExpectedException(MigrateException::class, "Missing one or both translation tables, 'i8n_strings' and 'locales_target'"); + $this->assertEquals($this->migrateMessages['error'], [new FormattableMarkup('Migration failed with source plugin exception: @e', ['@e' => "Missing one or both translation tables, 'i8n_strings' and 'locales_target'"])]); + $this->stopCollectingMessages(); } }