Skip to content
Snippets Groups Projects
Unverified Commit 65f070f4 authored by Alex Pott's avatar Alex Pott
Browse files

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

parent f75929b5
No related branches found
No related tags found
7 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!1012Issue #3226887: Hreflang on non-canonical content pages,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10,!596Issue #3046532: deleting an entity reference field, used in a contextual view, makes the whole site unrecoverable,!496Issue #2463967: Use .user.ini file for PHP settings,!144Issue #2666286: Clean up menu_ui to conform to Drupal coding standards,!16Draft: Resolve #2081585 "History storage"
......@@ -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]);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment