Unverified Commit 3e967309 authored by alexpott's avatar alexpott

Issue #3187794 by benjifisher: Remove redundant kernel tests in the Migrate module

(cherry picked from commit 65f070f4)
parent 1965d480
......@@ -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.
*/
......
......@@ -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]);
}
}
......@@ -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]);
}
......
......@@ -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]);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment