You are here

private function PotxTest::assertNoMsgIdContext in Translation template extractor 8

Assert the lack of a msgid with context in the .po file.

5 calls to PotxTest::assertNoMsgIdContext()
PotxTest::testDrupal5 in tests/src/Kernel/PotxTest.php
Test parsing of Drupal 5 module.
PotxTest::testDrupal6 in tests/src/Kernel/PotxTest.php
Test parsing of Drupal 6 module.
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::testDrupal8Twig in tests/src/Kernel/PotxTest.php
Test parsing of Drupal 8 Twig templates.

File

tests/src/Kernel/PotxTest.php, line 747

Class

PotxTest
Ensure that the translation template extractor functions properly.

Namespace

Drupal\Tests\potx\Kernel

Code

private function assertNoMsgIdContext($string, $context, $message = '', $group = 'Other') {
  if (!$message) {
    $message = new FormattableMarkup('No MsgID "@raw" in context "@context" found', [
      '@raw' => $string,
      '@context' => $context,
    ]);
  }
  $this
    ->assert(strpos($this->potx_output, 'msgid "' . _potx_format_quoted_string('"' . $string . '"') . '"' . "\nmsgctxt \"" . _potx_format_quoted_string('"' . $context . '"') . '"') === FALSE, $message, $group);
}