Skip to content
Snippets Groups Projects
Unverified Commit a4629b22 authored by Alex Pott's avatar Alex Pott
Browse files

Issue #3184184 by quietone, Wim Leers, marvil07: Test that the...

Issue #3184184 by quietone, Wim Leers, marvil07: Test that the d7_entity_reference_translation follow-up migration runs not just for node entities
parent 92a87eac
No related branches found
No related tags found
17 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!1896Issue #2940605: Can only intentionally re-render an entity with references 20 times,!1101Issue #2412669 by claudiu.cristea, Julfabre, sidharrell, catch, daffie,...,!1039Issue #2556069 by claudiu.cristea, bnjmnm, lauriii, pfrenssen, Tim Bozeman,...,!10223132456: Fix issue where views instances are emptied before an ajax request is complete,!1012Issue #3226887: Hreflang on non-canonical content pages,!872Draft: Issue #3221319: Race condition when creating menu links and editing content deletes menu links,!594Put each entity type table into a details element on admin/config/regional/content-language,!579Issue #2230909: Simple decimals fail to pass validation,!560Move callback classRemove outside of the loop,!555Issue #3202493,!512Issue #3207771: Menu UI node type form documentation points to non-existent function,!485Sets the autocomplete attribute for username/password input field on login form.,!449Issue #2784233: Allow multiple vocabularies in the taxonomy filter,!231Issue #2671162: summary text wysiwyg patch working fine on 9.2.0-dev,!43Resolve #3173180: Add UI for 'loading' html attribute to images,!30Issue #3182188: Updates composer usage to point at ./vendor/bin/composer
...@@ -8654,6 +8654,16 @@ ...@@ -8654,6 +8654,16 @@
'delta' => '0', 'delta' => '0',
'field_reference_target_id' => '2', 'field_reference_target_id' => '2',
)) ))
->values(array(
'entity_type' => 'user',
'bundle' => 'user',
'deleted' => '0',
'entity_id' => '2',
'revision_id' => '2',
'language' => 'und',
'delta' => '0',
'field_reference_target_id' => '3',
))
->execute(); ->execute();
$connection->schema()->createTable('field_data_field_reference_2', array( $connection->schema()->createTable('field_data_field_reference_2', array(
'fields' => array( 'fields' => array(
...@@ -15243,6 +15253,16 @@ ...@@ -15243,6 +15253,16 @@
'delta' => '0', 'delta' => '0',
'field_reference_target_id' => '2', 'field_reference_target_id' => '2',
)) ))
->values(array(
'entity_type' => 'user',
'bundle' => 'user',
'deleted' => '0',
'entity_id' => '2',
'revision_id' => '2',
'language' => 'und',
'delta' => '0',
'field_reference_target_id' => '3',
))
->execute(); ->execute();
$connection->schema()->createTable('field_revision_field_reference_2', array( $connection->schema()->createTable('field_revision_field_reference_2', array(
'fields' => array( 'fields' => array(
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
use Drupal\node\Entity\Node; use Drupal\node\Entity\Node;
use Drupal\Tests\file\Kernel\Migrate\d7\FileMigrationSetupTrait; use Drupal\Tests\file\Kernel\Migrate\d7\FileMigrationSetupTrait;
use Drupal\user\Entity\User;
/** /**
* Tests follow-up migrations. * Tests follow-up migrations.
...@@ -44,8 +45,8 @@ protected function setUp(): void { ...@@ -44,8 +45,8 @@ protected function setUp(): void {
$this->installEntitySchema('comment'); $this->installEntitySchema('comment');
$this->installSchema('node', ['node_access']); $this->installSchema('node', ['node_access']);
$this->migrateUsers();
$this->migrateFields(); $this->migrateFields();
$this->migrateUsers();
$this->executeMigrations([ $this->executeMigrations([
'language', 'language',
'd7_language_content_settings', 'd7_language_content_settings',
...@@ -86,6 +87,9 @@ public function testEntityReferenceTranslations() { ...@@ -86,6 +87,9 @@ public function testEntityReferenceTranslations() {
$this->assertSame('2', $translation->get('field_reference')->target_id); $this->assertSame('2', $translation->get('field_reference')->target_id);
$this->assertSame('2', $translation->get('field_reference_2')->target_id); $this->assertSame('2', $translation->get('field_reference_2')->target_id);
$user = User::load(2);
$this->assertSame('3', $user->get('field_reference')->target_id);
// Run the follow-up migrations. // Run the follow-up migrations.
$migration_plugin_manager = $this->container->get('plugin.manager.migration'); $migration_plugin_manager = $this->container->get('plugin.manager.migration');
$migration_plugin_manager->clearCachedDefinitions(); $migration_plugin_manager->clearCachedDefinitions();
...@@ -106,6 +110,9 @@ public function testEntityReferenceTranslations() { ...@@ -106,6 +110,9 @@ public function testEntityReferenceTranslations() {
$translation = $node->getTranslation('en'); $translation = $node->getTranslation('en');
$this->assertSame('2', $translation->get('field_reference')->target_id); $this->assertSame('2', $translation->get('field_reference')->target_id);
$this->assertSame('2', $translation->get('field_reference_2')->target_id); $this->assertSame('2', $translation->get('field_reference_2')->target_id);
$user = User::load(2);
$this->assertSame('2', $user->get('field_reference')->target_id);
} }
} }
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
use Drupal\node\Entity\Node; use Drupal\node\Entity\Node;
use Drupal\Tests\migrate_drupal_ui\Functional\MigrateUpgradeExecuteTestBase; use Drupal\Tests\migrate_drupal_ui\Functional\MigrateUpgradeExecuteTestBase;
use Drupal\user\Entity\User;
// cspell:ignore Multiupload Imagefield // cspell:ignore Multiupload Imagefield
...@@ -248,6 +249,8 @@ protected function assertFollowUpMigrationResults() { ...@@ -248,6 +249,8 @@ protected function assertFollowUpMigrationResults() {
$this->assertSame('2', $translation->get('field_reference')->target_id); $this->assertSame('2', $translation->get('field_reference')->target_id);
$this->assertSame('2', $translation->get('field_reference_2')->target_id); $this->assertSame('2', $translation->get('field_reference_2')->target_id);
$user = User::load(2);
$this->assertSame('2', $user->get('field_reference')->target_id);
} }
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment