You are here

private function PotxTest::assertPotxErrors in Translation template extractor 8

Assert the list of expected errors generated by potx from parsing the input files.

Parameters

array $expected_errors: The list of expected errors.

18 calls to PotxTest::assertPotxErrors()
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::testDrupal7WithSyntaxError in tests/src/Kernel/PotxTest.php
Test parsing of Drupal 7 module with a syntax error.
PotxTest::testDrupal8 in tests/src/Kernel/PotxTest.php
Test parsing of Drupal 8 module.

... See full list

File

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

Class

PotxTest
Ensure that the translation template extractor functions properly.

Namespace

Drupal\Tests\potx\Kernel

Code

private function assertPotxErrors($expected_errors) {
  $this
    ->assert(count($this->potx_status) == count($expected_errors), count($expected_errors) . ' error messages found');
  $potx_errors = array_column($this->potx_status, 0);
  foreach ($expected_errors as $assert_msg => $error_msg) {
    $key = array_search($error_msg, $potx_errors);
    $this
      ->assert($key !== FALSE, $assert_msg . ' found');
    if ($key !== FALSE) {
      unset($potx_errors[$key]);
    }
  }
}