Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
M
migrate_plus
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Custom Issue Tracker
Custom Issue Tracker
Labels
Merge Requests
1
Merge Requests
1
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
project
migrate_plus
Commits
5ce0364f
Commit
5ce0364f
authored
Apr 27, 2020
by
heddn
Committed by
heddn
Apr 27, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue
#3131401
by heddn: Return type void in tests
parent
b992e26f
Changes
35
Hide whitespace changes
Inline
Side-by-side
Showing
35 changed files
with
117 additions
and
118 deletions
+117
-118
composer.json
composer.json
+3
-0
migrate_example/migrate_example.info.yml
migrate_example/migrate_example.info.yml
+1
-2
migrate_example/migrate_example_setup/migrate_example_setup.info.yml
...mple/migrate_example_setup/migrate_example_setup.info.yml
+1
-2
migrate_example_advanced/migrate_example_advanced.info.yml
migrate_example_advanced/migrate_example_advanced.info.yml
+1
-2
migrate_example_advanced/migrate_example_advanced_setup/migrate_example_advanced_setup.info.yml
...le_advanced_setup/migrate_example_advanced_setup.info.yml
+1
-2
migrate_json_example/migrate_json_example.info.yml
migrate_json_example/migrate_json_example.info.yml
+1
-2
migrate_plus.info.yml
migrate_plus.info.yml
+1
-2
tests/modules/migrate_plus_test/migrate_plus_test.info.yml
tests/modules/migrate_plus_test/migrate_plus_test.info.yml
+1
-2
tests/src/Functional/LoadTest.php
tests/src/Functional/LoadTest.php
+2
-2
tests/src/Kernel/EntityLookupAccessTest.php
tests/src/Kernel/EntityLookupAccessTest.php
+2
-2
tests/src/Kernel/MigrateTableIncrementTest.php
tests/src/Kernel/MigrateTableIncrementTest.php
+3
-3
tests/src/Kernel/MigrateTableTest.php
tests/src/Kernel/MigrateTableTest.php
+4
-4
tests/src/Kernel/MigrationConfigEntityTest.php
tests/src/Kernel/MigrationConfigEntityTest.php
+4
-4
tests/src/Kernel/MigrationGroupTest.php
tests/src/Kernel/MigrationGroupTest.php
+3
-3
tests/src/Kernel/Plugin/migrate/process/DefaultEntityValueTest.php
.../Kernel/Plugin/migrate/process/DefaultEntityValueTest.php
+2
-2
tests/src/Kernel/Plugin/migrate/process/EntityGenerateTest.php
.../src/Kernel/Plugin/migrate/process/EntityGenerateTest.php
+6
-3
tests/src/Kernel/Plugin/migrate/process/EntityLookupTest.php
tests/src/Kernel/Plugin/migrate/process/EntityLookupTest.php
+2
-2
tests/src/Kernel/Plugin/migrate/process/FileBlobTest.php
tests/src/Kernel/Plugin/migrate/process/FileBlobTest.php
+2
-2
tests/src/Kernel/Plugin/migrate_plus/data_fetcher/HttpTest.php
.../src/Kernel/Plugin/migrate_plus/data_fetcher/HttpTest.php
+2
-2
tests/src/Kernel/Plugin/migrate_plus/data_parser/JsonTest.php
...s/src/Kernel/Plugin/migrate_plus/data_parser/JsonTest.php
+2
-2
tests/src/Kernel/Plugin/migrate_plus/data_parser/SimpleXmlTest.php
.../Kernel/Plugin/migrate_plus/data_parser/SimpleXmlTest.php
+8
-8
tests/src/Unit/DataParserPluginBaseTest.php
tests/src/Unit/DataParserPluginBaseTest.php
+3
-3
tests/src/Unit/data_fetcher/FileTest.php
tests/src/Unit/data_fetcher/FileTest.php
+4
-4
tests/src/Unit/data_fetcher/HttpTest.php
tests/src/Unit/data_fetcher/HttpTest.php
+5
-5
tests/src/Unit/process/ArrayPopTest.php
tests/src/Unit/process/ArrayPopTest.php
+4
-4
tests/src/Unit/process/ArrayShiftTest.php
tests/src/Unit/process/ArrayShiftTest.php
+4
-4
tests/src/Unit/process/DomApplyStylesTest.php
tests/src/Unit/process/DomApplyStylesTest.php
+6
-6
tests/src/Unit/process/DomMigrationLookupTest.php
tests/src/Unit/process/DomMigrationLookupTest.php
+6
-6
tests/src/Unit/process/DomStrReplaceTest.php
tests/src/Unit/process/DomStrReplaceTest.php
+5
-5
tests/src/Unit/process/DomTest.php
tests/src/Unit/process/DomTest.php
+6
-6
tests/src/Unit/process/MultipleValuesTest.php
tests/src/Unit/process/MultipleValuesTest.php
+2
-2
tests/src/Unit/process/SingleValueTest.php
tests/src/Unit/process/SingleValueTest.php
+2
-2
tests/src/Unit/process/SkipOnValueTest.php
tests/src/Unit/process/SkipOnValueTest.php
+10
-10
tests/src/Unit/process/StrReplaceTest.php
tests/src/Unit/process/StrReplaceTest.php
+6
-6
tests/src/Unit/process/TransliterationTest.php
tests/src/Unit/process/TransliterationTest.php
+2
-2
No files found.
composer.json
View file @
5ce0364f
...
...
@@ -25,5 +25,8 @@
"suggest"
:
{
"sainsburys/guzzle-oauth2-plugin"
:
"3.0 required for the OAuth2 authentication plugin"
,
"ext-soap"
:
"*"
},
"requires"
:
{
"php"
:
">=7.1"
}
}
migrate_example/migrate_example.info.yml
View file @
5ce0364f
...
...
@@ -2,8 +2,7 @@ type: module
name
:
Migrate Example
description
:
'
Examples
of
how
Drupal
8+
migration
compares
to
previous
versions.'
package
:
Examples
core
:
8.x
core_version_requirement
:
^8 || ^9
core_version_requirement
:
^8.8 || ^9
dependencies
:
-
drupal:migrate
-
migrate_plus:migrate_example_setup
...
...
migrate_example/migrate_example_setup/migrate_example_setup.info.yml
View file @
5ce0364f
...
...
@@ -2,8 +2,7 @@ type: module
name
:
Migrate Example Setup
description
:
'
Separate
site
configuration
for
the
example
from
the
actual
migration.'
package
:
Migration
core
:
8.x
core_version_requirement
:
^8 || ^9
core_version_requirement
:
^8.8 || ^9
hidden
:
true
dependencies
:
-
drupal:comment
...
...
migrate_example_advanced/migrate_example_advanced.info.yml
View file @
5ce0364f
...
...
@@ -2,8 +2,7 @@ type: module
name
:
Migrate Example (Advanced)
description
:
'
Specialized
examples
of
Drupal
8+
migration.'
package
:
Examples
core
:
8.x
core_version_requirement
:
^8 || ^9
core_version_requirement
:
^8.8 || ^9
dependencies
:
-
drupal:migrate
-
migrate_plus:migrate_example_advanced_setup
...
...
migrate_example_advanced/migrate_example_advanced_setup/migrate_example_advanced_setup.info.yml
View file @
5ce0364f
...
...
@@ -2,8 +2,7 @@ type: module
name
:
Migrate Advanced Example Setup
description
:
'
Separate
site
configuration
for
the
example
from
the
actual
migration.'
package
:
Migration
core
:
8.x
core_version_requirement
:
^8 || ^9
core_version_requirement
:
^8.8 || ^9
hidden
:
true
dependencies
:
-
drupal:comment
...
...
migrate_json_example/migrate_json_example.info.yml
View file @
5ce0364f
...
...
@@ -2,8 +2,7 @@ type: module
name
:
Migrate JSON Example
description
:
'
Simple
JSON
Migration
example'
package
:
Examples
core
:
8.x
core_version_requirement
:
^8 || ^9
core_version_requirement
:
^8.8 || ^9
dependencies
:
-
drupal:migrate
-
migrate_plus:migrate_plus
migrate_plus.info.yml
View file @
5ce0364f
...
...
@@ -2,7 +2,6 @@ type: module
name
:
Migrate Plus
description
:
'
Enhancements
to
core
migration
support'
package
:
Migration
core
:
8.x
core_version_requirement
:
^8 || ^9
core_version_requirement
:
^8.8 || ^9
dependencies
:
-
drupal:migrate
tests/modules/migrate_plus_test/migrate_plus_test.info.yml
View file @
5ce0364f
...
...
@@ -2,8 +2,7 @@ type: module
name
:
Migrate Plus Test
description
:
'
Test
module
to
test
Migrate
Plus.'
package
:
Testing
core
:
8.x
core_version_requirement
:
^8 || ^9
core_version_requirement
:
^8.8 || ^9
dependencies
:
-
drupal:migrate
-
migrate_plus:migrate_plus
tests/src/Functional/LoadTest.php
View file @
5ce0364f
...
...
@@ -39,7 +39,7 @@ class LoadTest extends BrowserTestBase {
/**
* {@inheritdoc}
*/
protected
function
setUp
()
{
protected
function
setUp
()
:
void
{
parent
::
setUp
();
$this
->
user
=
$this
->
drupalCreateUser
([
'administer site configuration'
]);
$this
->
drupalLogin
(
$this
->
user
);
...
...
@@ -48,7 +48,7 @@ class LoadTest extends BrowserTestBase {
/**
* Tests that the home page loads with a 200 response.
*/
public
function
testLoad
()
{
public
function
testLoad
()
:
void
{
$this
->
drupalGet
(
Url
::
fromRoute
(
'<front>'
));
$this
->
assertSession
()
->
statusCodeEquals
(
200
);
}
...
...
tests/src/Kernel/EntityLookupAccessTest.php
View file @
5ce0364f
...
...
@@ -50,7 +50,7 @@ class EntityLookupAccessTest extends KernelTestBase {
/**
* {@inheritdoc}
*/
protected
function
setUp
()
{
protected
function
setUp
()
:
void
{
parent
::
setUp
();
$this
->
installSchema
(
'system'
,
[
'sequences'
]);
$this
->
installEntitySchema
(
'entity_test'
);
...
...
@@ -64,7 +64,7 @@ class EntityLookupAccessTest extends KernelTestBase {
/**
* Tests that access is honored for entity lookups.
*/
public
function
testEntityLookupAccessCheck
()
{
public
function
testEntityLookupAccessCheck
()
:
void
{
$definition
=
[
'source'
=>
[
'plugin'
=>
'embedded_data'
,
...
...
tests/src/Kernel/MigrateTableIncrementTest.php
View file @
5ce0364f
...
...
@@ -29,7 +29,7 @@ class MigrateTableIncrementTest extends MigrateTestBase {
/**
* {@inheritdoc}
*/
protected
function
setUp
()
{
protected
function
setUp
()
:
void
{
parent
::
setUp
();
$this
->
connection
=
$this
->
container
->
get
(
'database'
);
$this
->
connection
->
schema
()
->
createTable
(
static
::
TABLE_NAME
,
[
...
...
@@ -57,7 +57,7 @@ class MigrateTableIncrementTest extends MigrateTestBase {
/**
* {@inheritdoc}
*/
protected
function
tearDown
()
{
protected
function
tearDown
()
:
void
{
$this
->
connection
->
schema
()
->
dropTable
(
static
::
TABLE_NAME
);
parent
::
tearDown
();
}
...
...
@@ -68,7 +68,7 @@ class MigrateTableIncrementTest extends MigrateTestBase {
* @return array
* The migration definition.
*/
public
function
tableDestinationMigration
()
{
public
function
tableDestinationMigration
()
:
array
{
return
[
'dummy table'
=>
[
[
...
...
tests/src/Kernel/MigrateTableTest.php
View file @
5ce0364f
...
...
@@ -39,7 +39,7 @@ class MigrateTableTest extends MigrateTestBase {
/**
* {@inheritdoc}
*/
protected
function
setUp
()
{
protected
function
setUp
()
:
void
{
parent
::
setUp
();
$this
->
connection
=
$this
->
container
->
get
(
'database'
);
...
...
@@ -98,7 +98,7 @@ class MigrateTableTest extends MigrateTestBase {
/**
* {@inheritdoc}
*/
protected
function
tearDown
()
{
protected
function
tearDown
()
:
void
{
$this
->
sourceDatabase
->
schema
()
->
dropTable
(
static
::
SOURCE_TABLE_NAME
);
$this
->
connection
->
schema
()
->
dropTable
(
static
::
DEST_TABLE_NAME
);
parent
::
tearDown
();
...
...
@@ -157,7 +157,7 @@ class MigrateTableTest extends MigrateTestBase {
/**
* Tests table migration.
*/
public
function
testTableMigration
()
{
public
function
testTableMigration
()
:
void
{
$definition
=
[
'id'
=>
'migration_table_test'
,
'migration_tags'
=>
[
'Testing'
],
...
...
@@ -214,7 +214,7 @@ class MigrateTableTest extends MigrateTestBase {
*
* @dataProvider tableDestinationMigration
*/
public
function
testTableUpdate
(
array
$definition
)
{
public
function
testTableUpdate
(
array
$definition
)
:
void
{
// Make sure migration overwrites the original data for the first row.
$original_values
=
[
'data'
=>
'dummy value'
,
...
...
tests/src/Kernel/MigrationConfigEntityTest.php
View file @
5ce0364f
...
...
@@ -37,7 +37,7 @@ class MigrationConfigEntityTest extends MigrateTestBase {
/**
* {@inheritdoc}
*/
protected
function
setUp
()
{
protected
function
setUp
()
:
void
{
parent
::
setUp
();
$this
->
pluginManager
=
\
Drupal
::
service
(
'plugin.manager.migration'
);
$this
->
installConfig
(
'migrate_plus'
);
...
...
@@ -48,7 +48,7 @@ class MigrationConfigEntityTest extends MigrateTestBase {
/**
* Tests cache invalidation.
*/
public
function
testCacheInvalidation
()
{
public
function
testCacheInvalidation
()
:
void
{
$config
=
Migration
::
create
([
'id'
=>
'test'
,
'status'
=>
TRUE
,
...
...
@@ -77,7 +77,7 @@ class MigrationConfigEntityTest extends MigrateTestBase {
/**
* Tests migration status.
*/
public
function
testMigrationStatus
()
{
public
function
testMigrationStatus
()
:
void
{
$configs
=
[
[
'id'
=>
'test_active'
,
...
...
@@ -115,7 +115,7 @@ class MigrationConfigEntityTest extends MigrateTestBase {
/**
* Tests migration from configuration.
*/
public
function
testImport
()
{
public
function
testImport
()
:
void
{
$this
->
installConfig
(
'migrate_plus_test'
);
/** @var \Drupal\migrate\Plugin\MigrationInterface $migration */
$migration
=
$this
->
pluginManager
->
createInstance
(
'fruit_terms'
);
...
...
tests/src/Kernel/MigrationGroupTest.php
View file @
5ce0364f
...
...
@@ -21,7 +21,7 @@ class MigrationGroupTest extends KernelTestBase {
/**
* Test that group configuration is properly merged into specific migrations.
*/
public
function
testConfigurationMerge
()
{
public
function
testConfigurationMerge
()
:
void
{
$group_id
=
'test_group'
;
/** @var \Drupal\migrate_plus\Entity\MigrationGroupInterface $migration_group */
...
...
@@ -96,7 +96,7 @@ class MigrationGroupTest extends KernelTestBase {
/**
* Test that deleting a group deletes its migrations.
*/
public
function
testDelete
()
{
public
function
testDelete
()
:
void
{
/** @var \Drupal\migrate_plus\Entity\MigrationGroupInterface $migration_group */
$group_configuration
=
[
'id'
=>
'test_group'
,
...
...
@@ -130,7 +130,7 @@ class MigrationGroupTest extends KernelTestBase {
/**
* Test that migrations without a group are assigned to the default group.
*/
public
function
testDefaultGroup
()
{
public
function
testDefaultGroup
()
:
void
{
$this
->
installConfig
(
'migrate_plus_test'
);
/** @var \Drupal\migrate\Plugin\MigrationPluginManagerInterface $pluginManager */
...
...
tests/src/Kernel/Plugin/migrate/process/DefaultEntityValueTest.php
View file @
5ce0364f
...
...
@@ -32,7 +32,7 @@ class DefaultEntityValueTest extends KernelTestBase {
/**
* {@inheritdoc}
*/
protected
function
setUp
()
{
protected
function
setUp
()
:
void
{
parent
::
setUp
();
$this
->
installSchema
(
'system'
,
[
'sequences'
]);
$this
->
installEntitySchema
(
'user'
);
...
...
@@ -43,7 +43,7 @@ class DefaultEntityValueTest extends KernelTestBase {
*
* @covers ::transform
*/
public
function
testDefaultEntityValue
()
{
public
function
testDefaultEntityValue
()
:
void
{
// Create a user.
$editorial_user
=
$this
->
createUser
([],
'editorial'
);
$journalist_user
=
$this
->
createUser
([],
'journalist'
);
...
...
tests/src/Kernel/Plugin/migrate/process/EntityGenerateTest.php
View file @
5ce0364f
...
...
@@ -71,7 +71,7 @@ class EntityGenerateTest extends KernelTestBase implements MigrateMessageInterfa
/**
* {@inheritdoc}
*/
protected
function
setUp
()
{
protected
function
setUp
()
:
void
{
parent
::
setUp
();
// Create article content type.
$values
=
[
...
...
@@ -132,7 +132,7 @@ class EntityGenerateTest extends KernelTestBase implements MigrateMessageInterfa
*
* @covers ::transform
*/
public
function
testTransform
(
array
$definition
,
array
$expected
,
array
$preSeed
=
[])
{
public
function
testTransform
(
array
$definition
,
array
$expected
,
array
$preSeed
=
[])
:
void
{
// Pre seed some test data.
foreach
(
$preSeed
as
$storageName
=>
$values
)
{
// If the first element of $values is a non-empty array, create multiple
...
...
@@ -149,8 +149,11 @@ class EntityGenerateTest extends KernelTestBase implements MigrateMessageInterfa
/** @var \Drupal\migrate\Plugin\Migration $migration */
$migration
=
$this
->
migrationPluginManager
->
createStubMigration
(
$definition
);
$reflector
=
new
\
ReflectionObject
(
$migration
->
getDestinationPlugin
());
$attribute
=
$reflector
->
getProperty
(
'storage'
);
$attribute
->
setAccessible
(
true
);
/** @var \Drupal\Core\Entity\EntityStorageBase $storage */
$storage
=
$
this
->
readAttribute
(
$migration
->
getDestinationPlugin
(),
'storage'
);
$storage
=
$
attribute
->
getValue
(
$migration
->
getDestinationPlugin
()
);
$migrationExecutable
=
(
new
MigrateExecutable
(
$migration
,
$this
));
$migrationExecutable
->
import
();
...
...
tests/src/Kernel/Plugin/migrate/process/EntityLookupTest.php
View file @
5ce0364f
...
...
@@ -32,7 +32,7 @@ class EntityLookupTest extends KernelTestBase {
/**
* {@inheritdoc}
*/
protected
function
setUp
()
{
protected
function
setUp
()
:
void
{
parent
::
setUp
();
$this
->
installSchema
(
'system'
,
[
'sequences'
]);
$this
->
installEntitySchema
(
'user'
);
...
...
@@ -46,7 +46,7 @@ class EntityLookupTest extends KernelTestBase {
*
* @covers ::transform
*/
public
function
testLookupEntityWithoutBundles
()
{
public
function
testLookupEntityWithoutBundles
()
:
void
{
// Create a user.
$known_user
=
$this
->
createUser
([],
'lucuma'
);
// Setup test migration objects.
...
...
tests/src/Kernel/Plugin/migrate/process/FileBlobTest.php
View file @
5ce0364f
...
...
@@ -58,7 +58,7 @@ class FileBlobTest extends KernelTestBase {
/**
* {@inheritdoc}
*/
protected
function
setUp
()
{
protected
function
setUp
()
:
void
{
parent
::
setUp
();
$this
->
pluginManager
=
$this
->
container
->
get
(
'plugin.manager.migrate.process'
);
...
...
@@ -200,7 +200,7 @@ EOT;
*
* @covers ::transform
*/
public
function
testFileCreation
()
{
public
function
testFileCreation
()
:
void
{
/** @var \Drupal\migrate\MigrateExecutableInterface $executable */
$executable
=
$this
->
prophesize
(
MigrateExecutableInterface
::
class
)
->
reveal
();
$row
=
new
Row
([],
[]);
...
...
tests/src/Kernel/Plugin/migrate_plus/data_fetcher/HttpTest.php
View file @
5ce0364f
...
...
@@ -18,7 +18,7 @@ class HttpTest extends KernelTestBase {
*
* @dataProvider headerDataProvider
*/
public
function
testHttpHeaders
(
array
$definition
,
array
$expected
,
array
$preSeed
=
[])
{
public
function
testHttpHeaders
(
array
$definition
,
array
$expected
,
array
$preSeed
=
[])
:
void
{
$http
=
new
Http
(
$definition
,
'http'
,
[]);
$this
->
assertEquals
(
$expected
,
$http
->
getRequestHeaders
());
}
...
...
@@ -29,7 +29,7 @@ class HttpTest extends KernelTestBase {
* @return array
* The test cases
*/
public
function
headerDataProvider
()
{
public
function
headerDataProvider
()
:
array
{
return
[
'dummy headers specified'
=>
[
'definition'
=>
[
...
...
tests/src/Kernel/Plugin/migrate_plus/data_parser/JsonTest.php
View file @
5ce0364f
...
...
@@ -33,7 +33,7 @@ class JsonTest extends KernelTestBase {
* @throws \Drupal\Component\Plugin\Exception\PluginException
* @throws \Exception
*/
public
function
testMissingProperties
(
$file
,
array
$ids
,
array
$fields
,
array
$expected
)
{
public
function
testMissingProperties
(
$file
,
array
$ids
,
array
$fields
,
array
$expected
)
:
void
{
$path
=
$this
->
container
->
get
(
'module_handler'
)
->
getModule
(
'migrate_plus'
)
...
...
@@ -69,7 +69,7 @@ class JsonTest extends KernelTestBase {
* @return array
* The test cases.
*/
public
function
jsonBaseDataProvider
()
{
public
function
jsonBaseDataProvider
()
:
array
{
return
[
'missing properties'
=>
[
'file'
=>
'missing_properties.json'
,
...
...
tests/src/Kernel/Plugin/migrate_plus/data_parser/SimpleXmlTest.php
View file @
5ce0364f
...
...
@@ -48,7 +48,7 @@ class SimpleXmlTest extends KernelTestBase {
/**
* {@inheritdoc}
*/
protected
function
setUp
()
{
protected
function
setUp
()
:
void
{
parent
::
setUp
();
$this
->
path
=
$this
->
container
->
get
(
'module_handler'
)
->
getModule
(
'migrate_plus'
)
->
getPath
();
...
...
@@ -89,7 +89,7 @@ class SimpleXmlTest extends KernelTestBase {
/**
* Tests reducing single values.
*/
public
function
testReduceSingleValue
()
{
public
function
testReduceSingleValue
()
:
void
{
$url
=
$this
->
path
.
'/tests/data/simple_xml_reduce_single_value.xml'
;
$this
->
configuration
[
'urls'
][
0
]
=
$url
;
$parser
=
$this
->
pluginManager
->
createInstance
(
'simple_xml'
,
$this
->
configuration
);
...
...
@@ -101,7 +101,7 @@ class SimpleXmlTest extends KernelTestBase {
*
* XML file with lots of different white spaces before the starting tag.
*/
public
function
testReadNonStandardXmlWhitespace
()
{
public
function
testReadNonStandardXmlWhitespace
()
:
void
{
$url
=
$this
->
path
.
'/tests/data/simple_xml_invalid_multi_whitespace.xml'
;
$this
->
configuration
[
'urls'
][
0
]
=
$url
;
...
...
@@ -114,7 +114,7 @@ class SimpleXmlTest extends KernelTestBase {
*
* XML file with one empty line before the starting tag.
*/
public
function
testReadNonStandardXml2
()
{
public
function
testReadNonStandardXml2
()
:
void
{
$url
=
$this
->
path
.
'/tests/data/simple_xml_invalid_single_line.xml'
;
$this
->
configuration
[
'urls'
][
0
]
=
$url
;
...
...
@@ -127,7 +127,7 @@ class SimpleXmlTest extends KernelTestBase {
*
* @throws \Drupal\Migrate\MigrateException
*/
public
function
testReadBrokenXmlMissingTag
()
{
public
function
testReadBrokenXmlMissingTag
()
:
void
{
$url
=
$this
->
path
.
'/tests/data/simple_xml_broken_missing_tag.xml'
;
$this
->
configuration
[
'urls'
][
0
]
=
$url
;
$this
->
expectException
(
MigrateException
::
class
);
...
...
@@ -141,7 +141,7 @@ class SimpleXmlTest extends KernelTestBase {
*
* @throws \Drupal\Migrate\MigrateException
*/
public
function
testReadBrokenXmlTagMismatch
()
{
public
function
testReadBrokenXmlTagMismatch
()
:
void
{
$url
=
$this
->
path
.
'/tests/data/simple_xml_broken_tag_mismatch.xml'
;
$this
->
configuration
[
'urls'
][
0
]
=
$url
;
...
...
@@ -157,7 +157,7 @@ class SimpleXmlTest extends KernelTestBase {
*
* @throws \Drupal\Migrate\MigrateException
*/
public
function
testReadNonXml
()
{
public
function
testReadNonXml
()
:
void
{
$url
=
$this
->
path
.
'/tests/data/simple_xml_non_xml.xml'
;
$this
->
configuration
[
'urls'
][
0
]
=
$url
;
...
...
@@ -172,7 +172,7 @@ class SimpleXmlTest extends KernelTestBase {
*
* @throws \Drupal\Migrate\MigrateException
*/
public
function
testReadNonExistingXml
()
{
public
function
testReadNonExistingXml
()
:
void
{
$url
=
$this
->
path
.
'/tests/data/simple_xml_non_existing.xml'
;
$this
->
configuration
[
'urls'
][
0
]
=
$url
;
...
...
tests/src/Unit/DataParserPluginBaseTest.php
View file @
5ce0364f
...
...
@@ -15,7 +15,7 @@ class DataParserPluginBaseTest extends MigrateTestCase {
/**
* @covers ::nextSource
*/
public
function
testNextSourceWithOneUrl
()
{
public
function
testNextSourceWithOneUrl
()
:
void
{
$parser
=
$this
->
getMockedDataParser
();
$parser
->
expects
(
$this
->
once
())
->
method
(
'openSourceUrl'
)
...
...
@@ -26,7 +26,7 @@ class DataParserPluginBaseTest extends MigrateTestCase {
/**
* @covers ::nextSource
*/
public
function
testNextSourceWithoutUrls
()
{
public
function
testNextSourceWithoutUrls
()
:
void
{
$config
=
[
'urls'
=>
[],
];
...
...
@@ -40,7 +40,7 @@ class DataParserPluginBaseTest extends MigrateTestCase {
/**
* @covers ::count
*/
public
function
testCountWithoutUrls
()
{
public
function
testCountWithoutUrls
()
:
void
{
$config
=
[
'urls'
=>
[],
];
...
...
tests/src/Unit/data_fetcher/FileTest.php
View file @
5ce0364f
...
...
@@ -83,14 +83,14 @@ class FileTest extends MigrateTestCase {
/**
* Set up test environment.
*/
public
function
setUp
()
{
public
function
setUp
()
:
void
{
$this
->
baseDir
=
vfsStream
::
setup
(
self
::
BASE_DIRECTORY
);
}
/**
* Test fetching a valid file.
*/
public
function
testFetchFile
()
{
public
function
testFetchFile
()
:
void
{
$file_name
=
'file.json'
;
$file_path
=
vfsStream
::
url
(
implode
(
DIRECTORY_SEPARATOR
,
[
self
::
BASE_DIRECTORY
,
$file_name
]));
$migration_config
=
$this
->
specificMigrationConfig
+
[
...
...
@@ -118,7 +118,7 @@ class FileTest extends MigrateTestCase {
/**
* Test fetching multiple valid files.
*/
public
function
testFetchMultipleFiles
()
{
public
function
testFetchMultipleFiles
()
:
void
{
$number_of_files
=
3
;
$file_paths
=
[];
$file_names
=
[];
...
...
@@ -159,7 +159,7 @@ class FileTest extends MigrateTestCase {
/**
* Test trying to fetch an unreadable file results in exception.
*/
public
function
testFetchUnreadableFile
()
{
public
function
testFetchUnreadableFile
()
:
void
{
$file_name
=
'file.json'
;
$file_path
=
vfsStream
::
url
(
implode
(
DIRECTORY_SEPARATOR
,
[
self
::
BASE_DIRECTORY
,
$file_name
]));
$migration_config
=
$this
->
specificMigrationConfig
+
[
...
...
tests/src/Unit/data_fetcher/HttpTest.php
View file @
5ce0364f
...
...
@@ -87,7 +87,7 @@ class HttpTest extends MigrateTestCase {
/**
* Set up test environment.
*/
public
function
setUp
()
{
public
function
setUp
()
:
void
{
// Mock up a Basic authentication plugin that will be used in requests.
$basic_authenticator
=
$this
->
getMockBuilder
(
Basic
::
class
)
->
disableOriginalConstructor
()
...
...
@@ -107,7 +107,7 @@ class HttpTest extends MigrateTestCase {
/**
* Test 'http' data fetcher (with auth) returns an expected response.
*/
public
function
testFetchHttpWithAuth
()
{
public
function
testFetchHttpWithAuth
()
:
void
{
$migration_config
=
$this
->
migrationConfiguration
+
$this
->
specificMigrationConfig
;
$plugin
=
new
TestHttp
(
$migration_config
,
$this
->
dataFetcherPluginId
,
$this
->
pluginDefinition
);
...
...
@@ -127,7 +127,7 @@ class HttpTest extends MigrateTestCase {
/**
* Test 'http' data fetcher (without auth) returns an expected response.
*/
public
function
testFetchHttpNoAuth
()
{
public
function
testFetchHttpNoAuth
()
:
void
{
$migration_config
=
$this
->
migrationConfiguration
+
$this
->
specificMigrationConfig
;
unset
(
$migration_config
[
'authentication'
]);
...
...
@@ -145,7 +145,7 @@ class HttpTest extends MigrateTestCase {
/**
* Test 'http' data fetcher (with auth) dies as expected when auth fails.
*/
public
function
testFetchHttpAuthFailure
()
{
public
function
testFetchHttpAuthFailure
()
:
void
{
$migration_config
=
$this
->
migrationConfiguration
+
$this
->
specificMigrationConfig
;
$plugin
=
new
TestHttp
(
$migration_config
,
$this
->
dataFetcherPluginId
,
$this
->
pluginDefinition
);
...
...
@@ -159,7 +159,7 @@ class HttpTest extends MigrateTestCase {
/**
* Test 'http' data fetcher (with auth) dies as expected when server down.
*/
public
function
testFetchHttp500Error
()
{
public
function
testFetchHttp500Error
()
:
void
{
$migration_config
=
$this
->
migrationConfiguration
+
$this
->
specificMigrationConfig
;
$plugin
=
new
TestHttp
(
$migration_config
,
$this
->
dataFetcherPluginId
,
$this
->
pluginDefinition
);
...
...
tests/src/Unit/process/ArrayPopTest.php
View file @
5ce0364f
...
...
@@ -17,7 +17,7 @@ class ArrayPopTest extends MigrateProcessTestCase {
/**
* {@inheritdoc}
*/
protected
function
setUp
()
{
protected
function
setUp
()
:
void
{
$this
->
plugin
=
new
ArrayPop
([],
'array_pop'
,
[]);
parent
::
setUp
();
}
...
...
@@ -28,7 +28,7 @@ class ArrayPopTest extends MigrateProcessTestCase {
* @return array
* An array containing input values and expected output values.
*/
public
function
arrayPopDataProvider
()
{
public
function
arrayPopDataProvider
()
:
array
{
return
[
'indexed array'
=>
[
'input'
=>
[
'v1'
,
'v2'
,
'v3'
],
...
...
@@ -55,7 +55,7 @@ class ArrayPopTest extends MigrateProcessTestCase {
*
* @dataProvider arrayPopDataProvider
*/
public
function
testArrayPop
(
array
$input
,
$expected_output
)
{
public
function
testArrayPop
(
array
$input
,
$expected_output
)
:
void
{
$output
=
$this
->
plugin
->
transform
(
$input
,
$this
->
migrateExecutable
,
$this
->
row
,
'destinationproperty'
);
$this
->
assertSame
(
$output
,
$expected_output
);
}
...
...
@@ -63,7 +63,7 @@ class ArrayPopTest extends MigrateProcessTestCase {
/**
* Test invalid input.
*/
public
function
testArrayPopFromString
()
{
public
function
testArrayPopFromString
()
:
void
{
$this
->
expectException
(
MigrateException
::
class
);
$this
->
expectExceptionMessage
(
'Input should be an array.'
);
$this
->
plugin
->
transform
(
'foo'
,
$this
->
migrateExecutable
,
$this
->
row
,
'destinationproperty'
);
...
...
tests/src/Unit/process/ArrayShiftTest.php
View file @
5ce0364f
...
...
@@ -17,7 +17,7 @@ class ArrayShiftTest extends MigrateProcessTestCase {
/**
* {@inheritdoc}
*/
protected
function
setUp
()
{
protected
function
setUp
()
:
void
{
$this
->
plugin
=
new
ArrayShift
([],
'array_shift'
,
[]);
parent
::
setUp
();
}
...
...
@@ -28,7 +28,7 @@ class ArrayShiftTest extends MigrateProcessTestCase {
* @return array
* An array containing input values and expected output values.
*/
public
function
arrayShiftDataProvider
()
{
public
function
arrayShiftDataProvider
()
:
array
{
return
[
'indexed array'
=>
[
'input'
=>
[
'v1'
,
'v2'
,
'v3'
],
...
...
@@ -55,7 +55,7 @@ class ArrayShiftTest extends MigrateProcessTestCase {
*
* @dataProvider arrayShiftDataProvider
*/
public
function
testArrayShift
(
array
$input
,
$expected_output
)
{
public
function
testArrayShift
(
array
$input
,
$expected_output
)
:
void
{
$output
=
$this
->
plugin
->
transform
(
$input
,
$this
->
migrateExecutable
,
$this
->
row
,
'destinationproperty'
);
$this
->
assertSame
(
$output
,
$expected_output
);
}
...
...
@@ -63,7 +63,7 @@ class ArrayShiftTest extends MigrateProcessTestCase {
/**
* Test invalid input.
*/
public
function
testArrayShiftFromString
()
{
public
function
testArrayShiftFromString
()
:
void
{
$this
->
expectException
(
MigrateException
::
class
);
$this
->
expectExceptionMessage
(
'Input should be an array.'
);
$this
->
plugin
->
transform
(
'foo'
,
$this
->
migrateExecutable
,
$this
->
row
,
'destinationproperty'
);
...
...
tests/src/Unit/process/DomApplyStylesTest.php
View file @
5ce0364f
...
...
@@ -41,14 +41,14 @@ class DomApplyStylesTest extends MigrateProcessTestCase {
/**
* Mock a config factory object.
*
* @var Drupal\Core\Config\ConfigFactoryInterface
* @var
\
Drupal\Core\Config\ConfigFactoryInterface
*/
protected
$configFactory
=
NULL
;
/**