// set statements, because we skip rendering variable output.
HelpTestTwigNodeVisitor::
setStateValue('return_chunk',
$chunk_num);
$text =
$this->
renderHelpTopic($template_text, 'translated_chunk'
);
$matches =
[];
$matched =
preg_match('|' . HelpTestTwigNodeVisitor::DELIMITER . '(.*)' . HelpTestTwigNodeVisitor::DELIMITER . '|',
$text,
$matches);
if ($matched) { $number_checked++;
$text =
$matches[1
];
$this->
assertNotEmpty($text, 'Topic ' .
$chunk_str . ' contains text'
);
// Verify the chunk is OK.
$this->
assertTrue(locale_string_is_safe($text), 'Topic ' .
$chunk_str . ' translatable string is locale-safe'
);
$this->
validateHtml($text,
$chunk_str);
} $chunk_num++;
} $this->
assertTrue($number_checked > 0, 'Tested at least one translated chunk in ' .
$id);
// Validate the HTML in the body with the translated text replaced by a
// dummy string, to verify that HTML syntax is not partly in and partly out
// of the translated text.
$text =
$this->
renderHelpTopic($template_text, 'replace_translated'
);
$this->
validateHtml($text,
$id);