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

Issue #2567851 by dawehner, joelpittet: Use assertText() instead of...

Issue #2567851 by dawehner, joelpittet: Use assertText() instead of t()/SafeMarkup::format() in NodeEditFormTest
parent 4eaec816
Branches
Tags
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
......@@ -77,9 +77,10 @@ public function testNodeEdit() {
$this->assertUrl($node->url('edit-form', ['absolute' => TRUE]));
// Check that the title and body fields are displayed with the correct values.
$active = '<span class="visually-hidden">' . t('(active tab)') . '</span>';
$link_text = t('!local-task-title!active', array('!local-task-title' => t('Edit'), '!active' => $active));
$this->assertText(strip_tags($link_text), 0, 'Edit tab found and marked active.');
// As you see the expected link text has no HTML, but we are using
$link_text = 'Edit<span class="visually-hidden">(active tab)</span>';
// @todo Ideally assertLink would support HTML, but it doesn't.
$this->assertRaw($link_text, 'Edit tab found and marked active.');
$this->assertFieldByName($title_key, $edit[$title_key], 'Title field displayed.');
$this->assertFieldByName($body_key, $edit[$body_key], 'Body field displayed.');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment