updated core
This commit is contained in:
@@ -5,8 +5,8 @@ package: Testing
|
||||
# version: VERSION
|
||||
# core: 8.x
|
||||
|
||||
# Information added by Drupal.org packaging script on 2017-11-03
|
||||
version: '8.4.2'
|
||||
# Information added by Drupal.org packaging script on 2018-01-03
|
||||
version: '8.4.4'
|
||||
core: '8.x'
|
||||
project: 'drupal'
|
||||
datestamp: 1509719929
|
||||
datestamp: 1515021228
|
||||
|
||||
@@ -4,8 +4,8 @@ package: Testing
|
||||
# version: VERSION
|
||||
# core: 8.x
|
||||
|
||||
# Information added by Drupal.org packaging script on 2017-11-03
|
||||
version: '8.4.2'
|
||||
# Information added by Drupal.org packaging script on 2018-01-03
|
||||
version: '8.4.4'
|
||||
core: '8.x'
|
||||
project: 'drupal'
|
||||
datestamp: 1509719929
|
||||
datestamp: 1515021228
|
||||
|
||||
+3
-3
@@ -7,8 +7,8 @@ dependencies:
|
||||
- node
|
||||
- migrate
|
||||
|
||||
# Information added by Drupal.org packaging script on 2017-11-03
|
||||
version: '8.4.2'
|
||||
# Information added by Drupal.org packaging script on 2018-01-03
|
||||
version: '8.4.4'
|
||||
core: '8.x'
|
||||
project: 'drupal'
|
||||
datestamp: 1509719929
|
||||
datestamp: 1515021228
|
||||
|
||||
+3
-3
@@ -6,8 +6,8 @@ package: Testing
|
||||
dependencies:
|
||||
- migrate
|
||||
|
||||
# Information added by Drupal.org packaging script on 2017-11-03
|
||||
version: '8.4.2'
|
||||
# Information added by Drupal.org packaging script on 2018-01-03
|
||||
version: '8.4.4'
|
||||
core: '8.x'
|
||||
project: 'drupal'
|
||||
datestamp: 1509719929
|
||||
datestamp: 1515021228
|
||||
|
||||
+3
-3
@@ -5,8 +5,8 @@ package: Testing
|
||||
# version: VERSION
|
||||
# core: 8.x
|
||||
|
||||
# Information added by Drupal.org packaging script on 2017-11-03
|
||||
version: '8.4.2'
|
||||
# Information added by Drupal.org packaging script on 2018-01-03
|
||||
version: '8.4.4'
|
||||
core: '8.x'
|
||||
project: 'drupal'
|
||||
datestamp: 1509719929
|
||||
datestamp: 1515021228
|
||||
|
||||
+3
-3
@@ -6,8 +6,8 @@ package: Testing
|
||||
dependencies:
|
||||
- migrate
|
||||
|
||||
# Information added by Drupal.org packaging script on 2017-11-03
|
||||
version: '8.4.2'
|
||||
# Information added by Drupal.org packaging script on 2018-01-03
|
||||
version: '8.4.4'
|
||||
core: '8.x'
|
||||
project: 'drupal'
|
||||
datestamp: 1509719929
|
||||
datestamp: 1515021228
|
||||
|
||||
@@ -66,7 +66,7 @@ class MigrateBundleTest extends MigrateTestBase {
|
||||
// Import and validate the term entity was created with the correct bundle.
|
||||
$term_executable = new MigrateExecutable($term_migration, $this);
|
||||
$term_executable->import();
|
||||
/** @var Term $term */
|
||||
/** @var \Drupal\taxonomy\Entity\Term $term */
|
||||
$term = Term::load(1);
|
||||
$this->assertEquals($term->bundle(), 'categories');
|
||||
}
|
||||
@@ -104,7 +104,7 @@ class MigrateBundleTest extends MigrateTestBase {
|
||||
// Import and validate the term entities were created with the correct bundle.
|
||||
$term_executable = new MigrateExecutable($term_migration, $this);
|
||||
$term_executable->import();
|
||||
/** @var Term $term */
|
||||
/** @var \Drupal\taxonomy\Entity\Term $term */
|
||||
$term = Term::load(1);
|
||||
$this->assertEquals($term->bundle(), 'categories');
|
||||
$term = Term::load(2);
|
||||
@@ -146,7 +146,7 @@ class MigrateBundleTest extends MigrateTestBase {
|
||||
// Import and validate the term entities were created with the correct bundle.
|
||||
$term_executable = new MigrateExecutable($term_migration, $this);
|
||||
$term_executable->import();
|
||||
/** @var Term $term */
|
||||
/** @var \Drupal\taxonomy\Entity\Term $term */
|
||||
$term = Term::load(1);
|
||||
$this->assertEquals($term->bundle(), 'categories');
|
||||
$term = Term::load(2);
|
||||
|
||||
@@ -69,7 +69,7 @@ class MigrateRollbackTest extends MigrateTestBase {
|
||||
$vocabulary_executable = new MigrateExecutable($vocabulary_migration, $this);
|
||||
$vocabulary_executable->import();
|
||||
foreach ($vocabulary_data_rows as $row) {
|
||||
/** @var Vocabulary $vocabulary */
|
||||
/** @var \Drupal\taxonomy\Entity\Vocabulary $vocabulary */
|
||||
$vocabulary = Vocabulary::load($row['id']);
|
||||
$this->assertTrue($vocabulary);
|
||||
$map_row = $vocabulary_id_map->getRowBySource(['id' => $row['id']]);
|
||||
@@ -122,7 +122,7 @@ class MigrateRollbackTest extends MigrateTestBase {
|
||||
$map_row['source_row_status'], MigrateIdMapInterface::ROLLBACK_PRESERVE);
|
||||
|
||||
foreach ($term_data_rows as $row) {
|
||||
/** @var Term $term */
|
||||
/** @var \Drupal\taxonomy\Entity\Term $term */
|
||||
$term = Term::load($row['id']);
|
||||
$this->assertTrue($term);
|
||||
$map_row = $term_id_map->getRowBySource(['id' => $row['id']]);
|
||||
|
||||
@@ -20,7 +20,7 @@ abstract class MigrateSourceTestBase extends KernelTestBase {
|
||||
/**
|
||||
* The mocked migration.
|
||||
*
|
||||
* @var MigrationInterface|\Prophecy\Prophecy\ObjectProphecy
|
||||
* @var \Drupal\migrate\Plugin\MigrationInterface|\Prophecy\Prophecy\ObjectProphecy
|
||||
*/
|
||||
protected $migration;
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ class MigrationTest extends KernelTestBase {
|
||||
'migration' => 'm1'
|
||||
],
|
||||
'f3' => [
|
||||
'plugin' => 'iterator',
|
||||
'plugin' => 'sub_process',
|
||||
'process' => [
|
||||
'target_id' => [
|
||||
'plugin' => 'migration',
|
||||
|
||||
@@ -19,7 +19,7 @@ class QueryBatchTest extends KernelTestBase {
|
||||
/**
|
||||
* The mocked migration.
|
||||
*
|
||||
* @var MigrationInterface|\Prophecy\Prophecy\ObjectProphecy
|
||||
* @var \Drupal\migrate\Plugin\MigrationInterface|\Prophecy\Prophecy\ObjectProphecy
|
||||
*/
|
||||
protected $migration;
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ class MigrationPluginManagerTest extends UnitTestCase {
|
||||
/**
|
||||
* A plugin manager.
|
||||
*
|
||||
* @param \Drupal\migrate\Plugin\MigrationPluginManager $pluginManager
|
||||
* @var \Drupal\migrate\Plugin\MigrationPluginManager
|
||||
*/
|
||||
protected $pluginManager;
|
||||
|
||||
|
||||
@@ -1,118 +0,0 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Contains \Drupal\Tests\migrate\Unit\MigrationStorageTest.
|
||||
*/
|
||||
|
||||
namespace Drupal\Tests\migrate\Unit;
|
||||
|
||||
use Drupal\Component\Uuid\UuidInterface;
|
||||
use Drupal\Core\Config\ConfigFactoryInterface;
|
||||
use Drupal\Core\Entity\EntityTypeInterface;
|
||||
use Drupal\Core\Entity\Query\QueryFactoryInterface;
|
||||
use Drupal\Core\Entity\Query\QueryInterface;
|
||||
use Drupal\Core\Language\LanguageManagerInterface;
|
||||
use Drupal\migrate\MigrationStorage;
|
||||
use Drupal\Tests\UnitTestCase;
|
||||
|
||||
/**
|
||||
* @coversDefaultClass \Drupal\migrate\MigrationStorage
|
||||
* @group migrate
|
||||
*/
|
||||
class MigrationStorageTest extends UnitTestCase {
|
||||
|
||||
/**
|
||||
* The migration storage.
|
||||
*
|
||||
* @var \Drupal\Tests\migrate\Unit\TestMigrationStorage
|
||||
*/
|
||||
protected $storage;
|
||||
|
||||
/**
|
||||
* The storage query.
|
||||
*
|
||||
* @var \Drupal\Core\Entity\Query\QueryInterface|\PHPUnit_Framework_MockObject_MockObject
|
||||
*/
|
||||
protected $query;
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function setUp() {
|
||||
$this->query = $this->getMock(QueryInterface::class);
|
||||
$this->query->method('condition')
|
||||
->willReturnSelf();
|
||||
|
||||
$query_factory = $this->getMock(QueryFactoryInterface::class);
|
||||
$query_factory->method('get')
|
||||
->willReturn($this->query);
|
||||
|
||||
$this->storage = new TestMigrationStorage(
|
||||
$this->getMock(EntityTypeInterface::class),
|
||||
$this->getMock(ConfigFactoryInterface::class),
|
||||
$this->getMock(UuidInterface::class),
|
||||
$this->getMock(LanguageManagerInterface::class),
|
||||
$query_factory
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests getVariantIds() when variants exist.
|
||||
*
|
||||
* @covers ::getVariantIds
|
||||
*/
|
||||
public function testGetVariantIdsWithVariants() {
|
||||
$this->query->method('execute')
|
||||
->willReturn(['d6_node__page', 'd6_node__article']);
|
||||
|
||||
$ids = $this->storage->getVariantIds(['d6_node:*', 'd6_user']);
|
||||
$this->assertSame(['d6_node__page', 'd6_node__article', 'd6_user'], $ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests getVariantIds() when no variants exist.
|
||||
*
|
||||
* @covers ::getVariantIds
|
||||
*/
|
||||
public function testGetVariantIdsNoVariants() {
|
||||
$this->query->method('execute')
|
||||
->willReturn([]);
|
||||
|
||||
$ids = $this->storage->getVariantIds(['d6_node:*', 'd6_user']);
|
||||
$this->assertSame(['d6_user'], $ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests getVariantIds().
|
||||
*
|
||||
* This tests getVariantIds() when no variants exist and there are no static
|
||||
* (non-variant) dependencies.
|
||||
*
|
||||
* @covers ::getVariantIds
|
||||
*/
|
||||
public function testGetVariantIdsNoVariantsOrStaticDependencies() {
|
||||
$this->query->method('execute')
|
||||
->willReturn([]);
|
||||
|
||||
$ids = $this->storage->getVariantIds(['d6_node:*', 'd6_node_revision:*']);
|
||||
$this->assertSame([], $ids);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Test version of \Drupal\migrate\MigrationStorage.
|
||||
*
|
||||
* This class exposes protected methods for testing.
|
||||
*/
|
||||
class TestMigrationStorage extends MigrationStorage {
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getVariantIds(array $ids) {
|
||||
return parent::getVariantIds($ids);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user