Update to Drupal 8.2.2. For more information, see https://www.drupal.org/project/drupal/releases/8.2.2
This commit is contained in:
parent
23ffed3665
commit
507b45a0ed
378 changed files with 11434 additions and 5542 deletions
|
|
@ -0,0 +1,48 @@
|
|||
<?php
|
||||
|
||||
namespace Drupal\Tests\path\Kernel\Plugin\migrate\source\d6;
|
||||
|
||||
use Drupal\Tests\migrate\Kernel\MigrateSqlSourceTestBase;
|
||||
|
||||
/**
|
||||
* Tests the d6_url_alias source plugin.
|
||||
*
|
||||
* @covers \Drupal\path\Plugin\migrate\source\d6\UrlAlias
|
||||
* @group path
|
||||
*/
|
||||
class UrlAliasTest extends MigrateSqlSourceTestBase {
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public static $modules = ['migrate_drupal', 'path'];
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function providerSource() {
|
||||
$tests = [];
|
||||
|
||||
// The source data.
|
||||
$tests[0]['source_data']['url_alias'] = [
|
||||
[
|
||||
'pid' => 1,
|
||||
'src' => 'node/1',
|
||||
'dst' => 'test-article',
|
||||
'language' => 'en',
|
||||
],
|
||||
[
|
||||
'pid' => 2,
|
||||
'src' => 'node/2',
|
||||
'dst' => 'another-alias',
|
||||
'language' => 'en',
|
||||
],
|
||||
];
|
||||
|
||||
// The expected results.
|
||||
$tests[0]['expected_data'] = $tests[0]['source_data']['url_alias'];
|
||||
|
||||
return $tests;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,48 @@
|
|||
<?php
|
||||
|
||||
namespace Drupal\Tests\path\Kernel\Plugin\migrate\source\d7;
|
||||
|
||||
use Drupal\Tests\migrate\Kernel\MigrateSqlSourceTestBase;
|
||||
|
||||
/**
|
||||
* Tests the d7_url_alias source plugin.
|
||||
*
|
||||
* @covers \Drupal\path\Plugin\migrate\source\d7\UrlAlias
|
||||
* @group path
|
||||
*/
|
||||
class UrlAliasTest extends MigrateSqlSourceTestBase {
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public static $modules = ['migrate_drupal', 'path'];
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function providerSource() {
|
||||
$tests = [];
|
||||
|
||||
// The source data.
|
||||
$tests[0]['source_data']['url_alias'] = [
|
||||
[
|
||||
'pid' => 1,
|
||||
'source' => 'node/1',
|
||||
'alias' => 'test-article',
|
||||
'language' => 'en',
|
||||
],
|
||||
[
|
||||
'pid' => 2,
|
||||
'source' => 'node/2',
|
||||
'alias' => 'another-alias',
|
||||
'language' => 'en',
|
||||
],
|
||||
];
|
||||
|
||||
// The expected results.
|
||||
$tests[0]['expected_data'] = $tests[0]['source_data']['url_alias'];
|
||||
|
||||
return $tests;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,20 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace Drupal\Tests\path\Unit\Migrate;
|
||||
|
||||
use Drupal\Tests\migrate\Unit\MigrateSqlSourceTestCase;
|
||||
|
||||
/**
|
||||
* Base class for url_alias source tests.
|
||||
*/
|
||||
abstract class UrlAliasTestBase extends MigrateSqlSourceTestCase {
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function setUp() {
|
||||
$this->databaseContents['url_alias'] = $this->expectedResults;
|
||||
parent::setUp();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,38 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace Drupal\Tests\path\Unit\Migrate\d6;
|
||||
|
||||
use Drupal\Tests\path\Unit\Migrate\UrlAliasTestBase;
|
||||
|
||||
/**
|
||||
* Tests the d6_url_alias source plugin.
|
||||
*
|
||||
* @group path
|
||||
*/
|
||||
class UrlAliasTest extends UrlAliasTestBase {
|
||||
|
||||
const PLUGIN_CLASS = 'Drupal\path\Plugin\migrate\source\d6\UrlAlias';
|
||||
|
||||
protected $migrationConfiguration = array(
|
||||
'id' => 'test',
|
||||
'source' => array(
|
||||
'plugin' => 'd6_url_alias',
|
||||
),
|
||||
);
|
||||
|
||||
protected $expectedResults = array(
|
||||
array(
|
||||
'pid' => 1,
|
||||
'src' => 'node/1',
|
||||
'dst' => 'test-article',
|
||||
'language' => 'en',
|
||||
),
|
||||
array(
|
||||
'pid' => 2,
|
||||
'src' => 'node/2',
|
||||
'dst' => 'another-alias',
|
||||
'language' => 'en',
|
||||
),
|
||||
);
|
||||
|
||||
}
|
||||
|
|
@ -1,38 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace Drupal\Tests\path\Unit\Migrate\d7;
|
||||
|
||||
use Drupal\Tests\path\Unit\Migrate\UrlAliasTestBase;
|
||||
|
||||
/**
|
||||
* Tests the d7_url_alias source plugin.
|
||||
*
|
||||
* @group path
|
||||
*/
|
||||
class UrlAliasTest extends UrlAliasTestBase {
|
||||
|
||||
const PLUGIN_CLASS = 'Drupal\path\Plugin\migrate\source\d7\UrlAlias';
|
||||
|
||||
protected $migrationConfiguration = array(
|
||||
'id' => 'test',
|
||||
'source' => array(
|
||||
'plugin' => 'd7_url_alias',
|
||||
),
|
||||
);
|
||||
|
||||
protected $expectedResults = array(
|
||||
array(
|
||||
'pid' => 1,
|
||||
'source' => 'node/1',
|
||||
'alias' => 'test-article',
|
||||
'language' => 'en',
|
||||
),
|
||||
array(
|
||||
'pid' => 2,
|
||||
'source' => 'node/2',
|
||||
'alias' => 'another-alias',
|
||||
'language' => 'en',
|
||||
),
|
||||
);
|
||||
|
||||
}
|
||||
Reference in a new issue