Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
project
drupal
Commits
3e967309
Unverified
Commit
3e967309
authored
Dec 11, 2020
by
alexpott
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue
#3187794
by benjifisher: Remove redundant kernel tests in the Migrate module
(cherry picked from commit
65f070f4
)
parent
1965d480
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
2 additions
and
21 deletions
+2
-21
core/modules/migrate/tests/src/Kernel/MigrateLookupTest.php
core/modules/migrate/tests/src/Kernel/MigrateLookupTest.php
+0
-11
core/modules/migrate/tests/src/Kernel/MigrateStubTest.php
core/modules/migrate/tests/src/Kernel/MigrateStubTest.php
+0
-10
core/modules/migrate/tests/src/Unit/MigrateLookupTest.php
core/modules/migrate/tests/src/Unit/MigrateLookupTest.php
+1
-0
core/modules/migrate/tests/src/Unit/MigrateStubTest.php
core/modules/migrate/tests/src/Unit/MigrateStubTest.php
+1
-0
No files found.
core/modules/migrate/tests/src/Kernel/MigrateLookupTest.php
View file @
3e967309
...
...
@@ -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.
*/
...
...
core/modules/migrate/tests/src/Kernel/MigrateStubTest.php
View file @
3e967309
...
...
@@ -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
]);
}
}
core/modules/migrate/tests/src/Unit/MigrateLookupTest.php
View file @
3e967309
...
...
@@ -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
]);
}
...
...
core/modules/migrate/tests/src/Unit/MigrateStubTest.php
View file @
3e967309
...
...
@@ -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
]);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment