X-Git-Url: http://aleph1.co.uk/gitweb/?a=blobdiff_plain;ds=sidebyside;f=web%2Fcore%2Fmodules%2Fnode%2Ftests%2Fsrc%2FFunctional%2FViews%2FBulkFormTest.php;h=eded04530d0a6dc395caf33f93c8a305f326f4ca;hb=0bf8d09d2542548982e81a441b1f16e75873a04f;hp=458933e04e1ae4ab0dd5107ff9e9e38fe57f23a1;hpb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae;p=yaffs-website diff --git a/web/core/modules/node/tests/src/Functional/Views/BulkFormTest.php b/web/core/modules/node/tests/src/Functional/Views/BulkFormTest.php index 458933e04..eded04530 100644 --- a/web/core/modules/node/tests/src/Functional/Views/BulkFormTest.php +++ b/web/core/modules/node/tests/src/Functional/Views/BulkFormTest.php @@ -2,7 +2,7 @@ namespace Drupal\Tests\node\Functional\Views; -use Drupal\Component\Utility\SafeMarkup; +use Drupal\Component\Render\FormattableMarkup; use Drupal\language\Entity\ConfigurableLanguage; use Drupal\views\Views; @@ -55,7 +55,7 @@ class BulkFormTest extends NodeTestBase { 'promote' => FALSE, ]; $node = $this->drupalCreateNode($values); - $this->pass(SafeMarkup::format('Node %title created with language %langcode.', ['%title' => $node->label(), '%langcode' => $node->language()->getId()])); + $this->pass(new FormattableMarkup('Node %title created with language %langcode.', ['%title' => $node->label(), '%langcode' => $node->language()->getId()])); $this->nodes[] = $node; } @@ -66,7 +66,7 @@ class BulkFormTest extends NodeTestBase { if (!$node->hasTranslation($langcode)) { $title = $this->randomMachineName() . ' [' . $node->id() . ':' . $langcode . ']'; $translation = $node->addTranslation($langcode, ['title' => $title, 'promote' => FALSE]); - $this->pass(SafeMarkup::format('Translation %title created with language %langcode.', ['%title' => $translation->label(), '%langcode' => $translation->language()->getId()])); + $this->pass(new FormattableMarkup('Translation %title created with language %langcode.', ['%title' => $translation->label(), '%langcode' => $translation->language()->getId()])); } } $node->save(); @@ -77,7 +77,7 @@ class BulkFormTest extends NodeTestBase { $langcode = 'en'; $title = $this->randomMachineName() . ' [' . $node->id() . ':' . $langcode . ']'; $translation = $node->addTranslation($langcode, ['title' => $title]); - $this->pass(SafeMarkup::format('Translation %title created with language %langcode.', ['%title' => $translation->label(), '%langcode' => $translation->language()->getId()])); + $this->pass(new FormattableMarkup('Translation %title created with language %langcode.', ['%title' => $translation->label(), '%langcode' => $translation->language()->getId()])); $node->save(); // Check that all created translations are selected by the test view. @@ -170,19 +170,29 @@ class BulkFormTest extends NodeTestBase { // operations are always applied to individual translations. $edit = [ // Original and all translations. - 'node_bulk_form[0]' => TRUE, // Node 1, English, original. - 'node_bulk_form[1]' => TRUE, // Node 1, British English. - 'node_bulk_form[2]' => TRUE, // Node 1, Italian. + // Node 1, English, original. + 'node_bulk_form[0]' => TRUE, + // Node 1, British English. + 'node_bulk_form[1]' => TRUE, + // Node 1, Italian. + 'node_bulk_form[2]' => TRUE, // Original and only one translation. - 'node_bulk_form[3]' => TRUE, // Node 2, English. - 'node_bulk_form[4]' => TRUE, // Node 2, British English, original. - 'node_bulk_form[5]' => FALSE, // Node 2, Italian. + // Node 2, English. + 'node_bulk_form[3]' => TRUE, + // Node 2, British English, original. + 'node_bulk_form[4]' => TRUE, + // Node 2, Italian. + 'node_bulk_form[5]' => FALSE, // Only a single translation. - 'node_bulk_form[6]' => TRUE, // Node 3, English. - 'node_bulk_form[7]' => FALSE, // Node 3, Italian, original. + // Node 3, English. + 'node_bulk_form[6]' => TRUE, + // Node 3, Italian, original. + 'node_bulk_form[7]' => FALSE, // Only a single untranslated node. - 'node_bulk_form[8]' => TRUE, // Node 4, English, untranslated. - 'node_bulk_form[9]' => FALSE, // Node 5, British English, untranslated. + // Node 4, English, untranslated. + 'node_bulk_form[8]' => TRUE, + // Node 5, British English, untranslated. + 'node_bulk_form[9]' => FALSE, 'action' => 'node_unpublish_action', ]; $this->drupalPostForm(NULL, $edit, t('Apply to selected items')); @@ -211,33 +221,43 @@ class BulkFormTest extends NodeTestBase { // nodes and individual translations are properly deleted. $edit = [ // Original and all translations. - 'node_bulk_form[0]' => TRUE, // Node 1, English, original. - 'node_bulk_form[1]' => TRUE, // Node 1, British English. - 'node_bulk_form[2]' => TRUE, // Node 1, Italian. + // Node 1, English, original. + 'node_bulk_form[0]' => TRUE, + // Node 1, British English. + 'node_bulk_form[1]' => TRUE, + // Node 1, Italian. + 'node_bulk_form[2]' => TRUE, // Original and only one translation. - 'node_bulk_form[3]' => TRUE, // Node 2, English. - 'node_bulk_form[4]' => TRUE, // Node 2, British English, original. - 'node_bulk_form[5]' => FALSE, // Node 2, Italian. + // Node 2, English. + 'node_bulk_form[3]' => TRUE, + // Node 2, British English, original. + 'node_bulk_form[4]' => TRUE, + // Node 2, Italian. + 'node_bulk_form[5]' => FALSE, // Only a single translation. - 'node_bulk_form[6]' => TRUE, // Node 3, English. - 'node_bulk_form[7]' => FALSE, // Node 3, Italian, original. + // Node 3, English. + 'node_bulk_form[6]' => TRUE, + // Node 3, Italian, original. + 'node_bulk_form[7]' => FALSE, // Only a single untranslated node. - 'node_bulk_form[8]' => TRUE, // Node 4, English, untranslated. - 'node_bulk_form[9]' => FALSE, // Node 5, British English, untranslated. + // Node 4, English, untranslated. + 'node_bulk_form[8]' => TRUE, + // Node 5, British English, untranslated. + 'node_bulk_form[9]' => FALSE, 'action' => 'node_delete_action', ]; $this->drupalPostForm(NULL, $edit, t('Apply to selected items')); $label = $this->loadNode(1)->label(); - $this->assertText("$label (Original translation) - The following content translations will be deleted:"); + $this->assertText("$label (Original translation) - The following content item translations will be deleted:"); $label = $this->loadNode(2)->label(); - $this->assertText("$label (Original translation) - The following content translations will be deleted:"); + $this->assertText("$label (Original translation) - The following content item translations will be deleted:"); $label = $this->loadNode(3)->getTranslation('en')->label(); $this->assertText($label); - $this->assertNoText("$label (Original translation) - The following content translations will be deleted:"); + $this->assertNoText("$label (Original translation) - The following content item translations will be deleted:"); $label = $this->loadNode(4)->label(); $this->assertText($label); - $this->assertNoText("$label (Original translation) - The following content translations will be deleted:"); + $this->assertNoText("$label (Original translation) - The following content item translations will be deleted:"); $this->drupalPostForm(NULL, [], t('Delete')); @@ -253,7 +273,7 @@ class BulkFormTest extends NodeTestBase { $node = $this->loadNode(5); $this->assertTrue($node, '5: Node has not been deleted'); - $this->assertText('Deleted 8 posts.'); + $this->assertText('Deleted 8 content items.'); } /**