diff --git a/core/modules/migrate/tests/src/Kernel/MigrateLookupTest.php b/core/modules/migrate/tests/src/Kernel/MigrateLookupTest.php index 4affaa388465935f113e74d173206b085ace4dca..4b2ec45b7d3a97d0e1c0efef6eb0e29f36190982 100644 --- a/core/modules/migrate/tests/src/Kernel/MigrateLookupTest.php +++ b/core/modules/migrate/tests/src/Kernel/MigrateLookupTest.php @@ -2,7 +2,6 @@ namespace Drupal\Tests\migrate\Kernel; -use Drupal\Component\Plugin\Exception\PluginNotFoundException; use Drupal\migrate\MigrateException; use Drupal\Tests\node\Traits\ContentTypeCreationTrait; @@ -78,16 +77,6 @@ public function testInvalidIdLookup() { $this->migrateLookup->lookup('sample_lookup_migration', ['invalid_id' => 25]); } - /** - * Tests an invalid lookup. - */ - public function testInvalidMigrationLookup() { - $this->expectException(PluginNotFoundException::class); - $this->expectExceptionMessage("Plugin ID 'invalid_migration' was not found."); - // Test invalid migration_id. - $this->migrateLookup->lookup('invalid_migration', ['id' => 1337]); - } - /** * Tests lookups with multiple source ids. */ diff --git a/core/modules/migrate/tests/src/Kernel/MigrateStubTest.php b/core/modules/migrate/tests/src/Kernel/MigrateStubTest.php index 51b9058fa643a6f8a99aaeb1993d7c41c4c91b22..817e54ba5be4ea6685ccf3c415da57c3f5f7e5cf 100644 --- a/core/modules/migrate/tests/src/Kernel/MigrateStubTest.php +++ b/core/modules/migrate/tests/src/Kernel/MigrateStubTest.php @@ -2,7 +2,6 @@ namespace Drupal\Tests\migrate\Kernel; -use Drupal\Component\Plugin\Exception\PluginNotFoundException; use Drupal\Tests\node\Traits\ContentTypeCreationTrait; /** @@ -118,13 +117,4 @@ public function testInvalidSourceIdKeys() { $this->migrateStub->createStub('sample_stubbing_migration_with_multiple_source_ids', ['id' => 17, 'not_a_key' => 17]); } - /** - * Tests that an exception is thrown if a migration does not exist. - */ - public function testErrorOnMigrationNotFound() { - $this->expectException(PluginNotFoundException::class); - $this->expectExceptionMessage("Plugin ID 'nonexistent_migration' was not found."); - $this->migrateStub->createStub('nonexistent_migration', [1]); - } - } diff --git a/core/modules/migrate/tests/src/Unit/MigrateLookupTest.php b/core/modules/migrate/tests/src/Unit/MigrateLookupTest.php index 417b08a864477e92a069c9308b4d4d301be31a10..54fa42d2261ca23258c3ede4a783811cfe643ba0 100644 --- a/core/modules/migrate/tests/src/Unit/MigrateLookupTest.php +++ b/core/modules/migrate/tests/src/Unit/MigrateLookupTest.php @@ -53,6 +53,7 @@ public function testExceptionOnMigrationNotFound() { $migration_plugin_manager = $this->prophesize(MigrationPluginManagerInterface::class); $migration_plugin_manager->createInstances('bad_plugin')->willReturn([]); $this->expectException(PluginNotFoundException::class); + $this->expectExceptionMessage("Plugin ID 'bad_plugin' was not found."); $lookup = new MigrateLookup($migration_plugin_manager->reveal()); $lookup->lookup('bad_plugin', [1]); } diff --git a/core/modules/migrate/tests/src/Unit/MigrateStubTest.php b/core/modules/migrate/tests/src/Unit/MigrateStubTest.php index 4a68dfdffc69501f471e4e1d81fc49b92e3c6098..a89ab35628619ee472bd21228001ab54ecc25448 100644 --- a/core/modules/migrate/tests/src/Unit/MigrateStubTest.php +++ b/core/modules/migrate/tests/src/Unit/MigrateStubTest.php @@ -72,6 +72,7 @@ public function testCreateStub() { public function testExceptionOnPluginNotFound() { $this->migrationPluginManager->createInstances(['test_migration'])->willReturn([]); $this->expectException(PluginNotFoundException::class); + $this->expectExceptionMessage("Plugin ID 'test_migration' was not found."); $stub = new MigrateStub($this->migrationPluginManager->reveal()); $stub->createStub('test_migration', [1]); }