Skip to content
Snippets Groups Projects
Verified Commit d0c502d1 authored by Lee Rowlands's avatar Lee Rowlands
Browse files

Issue #2937841 by quietone: Assert plural labels exist on migrate upgrade form

parent 626a6aa3
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
...@@ -106,7 +106,16 @@ public function testMigrateUpgradeExecute() { ...@@ -106,7 +106,16 @@ public function testMigrateUpgradeExecute() {
$session->fieldExists('mysql[host]'); $session->fieldExists('mysql[host]');
$this->drupalPostForm(NULL, $edits, t('Review upgrade')); $this->drupalPostForm(NULL, $edits, t('Review upgrade'));
$this->assertIdConflict($session); $entity_types = [
'block_content',
'menu_link_content',
'file',
'taxonomy_term',
'user',
'comment',
'node',
];
$this->assertIdConflict($session, $entity_types);
$this->drupalPostForm(NULL, [], t('I acknowledge I may lose data. Continue anyway.')); $this->drupalPostForm(NULL, [], t('I acknowledge I may lose data. Continue anyway.'));
$session->statusCodeEquals(200); $session->statusCodeEquals(200);
......
...@@ -193,20 +193,20 @@ protected function assertReviewPage(WebAssert $session, array $available_paths, ...@@ -193,20 +193,20 @@ protected function assertReviewPage(WebAssert $session, array $available_paths,
* *
* @param \Drupal\Tests\WebAssert $session * @param \Drupal\Tests\WebAssert $session
* The current session. * The current session.
* @param $session * @param array $entity_types
* The current session. * An array of entity types
*/ */
protected function assertIdConflict(WebAssert $session) { protected function assertIdConflict(WebAssert $session, $entity_types) {
/** @var \Drupal\ $entity_type_manager */
$entity_type_manager = \Drupal::service('entity_type.manager');
$session->pageTextContains('WARNING: Content may be overwritten on your new site.'); $session->pageTextContains('WARNING: Content may be overwritten on your new site.');
$session->pageTextContains('There is conflicting content of these types:'); $session->pageTextContains('There is conflicting content of these types:');
$session->pageTextContains('custom blocks'); foreach ($entity_types as $entity_type) {
$session->pageTextContains('custom menu links'); $label = $entity_type_manager->getDefinition($entity_type)->getPluralLabel();
$session->pageTextContains('files'); $session->pageTextContains($label);
$session->pageTextContains('taxonomy terms'); }
$session->pageTextContains('users');
$session->pageTextContains('comments');
$session->pageTextContains('content item revisions'); $session->pageTextContains('content item revisions');
$session->pageTextContains('content items');
$session->pageTextContains('There is translated content of these types:'); $session->pageTextContains('There is translated content of these types:');
} }
......
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