Unverified Commit 3e967309 authored by Alex Pott's avatar Alex Pott
Browse files

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

(cherry picked from commit 65f070f4)
parent 1965d480
Loading
Loading
Loading
Loading
+0 −11
Original line number Diff line number Diff line
@@ -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.
   */
+0 −10
Original line number Diff line number Diff line
@@ -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]);
  }

}
+1 −0
Original line number Diff line number Diff line
@@ -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]);
  }
+1 −0
Original line number Diff line number Diff line
@@ -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]);
  }