private function PotxTest::assertMsgIdContext in Translation template extractor 8
Assert a msgid with context in the .po file.
9 calls to PotxTest::assertMsgIdContext()
- PotxTest::testDrupal7 in tests/
src/ Kernel/ PotxTest.php - Test parsing of Drupal 7 module.
- PotxTest::testDrupal8 in tests/
src/ Kernel/ PotxTest.php - Test parsing of Drupal 8 module.
- PotxTest::testDrupal8CustomYml in tests/
src/ Kernel/ PotxTest.php - Test parsing of custom yaml files.
- PotxTest::testDrupal8LocalContextualYml in tests/
src/ Kernel/ PotxTest.php - Test parsing of Drupal 8 local tasks, contextual link and action files.
- PotxTest::testDrupal8MenuLinksYml in tests/
src/ Kernel/ PotxTest.php - Test parsing of Drupal 8 menu link files.
File
- tests/
src/ Kernel/ PotxTest.php, line 737
Class
- PotxTest
- Ensure that the translation template extractor functions properly.
Namespace
Drupal\Tests\potx\KernelCode
private function assertMsgIdContext($string, $context, $message = '', $group = 'Other') {
if (!$message) {
$message = new FormattableMarkup('MsgID "@raw" in context "@context" found', [
'@raw' => $string,
'@context' => $context,
]);
}
$this
->assert(strpos($this->potx_output, 'msgctxt "' . _potx_format_quoted_string('"' . $context . '"') . "\"\nmsgid \"" . _potx_format_quoted_string('"' . $string . '"') . '"') !== FALSE, $message, $group);
}