function FileEncodingConstraintValidatorTest::getInvalidEncodedPoFile

Helper function that returns a .po file with invalid encoding.

File

core/modules/file/tests/src/Kernel/Plugin/Validation/Constraint/FileEncodingConstraintValidatorTest.php, line 91

Class

FileEncodingConstraintValidatorTest
Tests the FileEncodingConstraintValidator.

Namespace

Drupal\Tests\file\Kernel\Plugin\Validation\Constraint

Code

public function getInvalidEncodedPoFile() {
    return <<<EOF
msgid ""
msgstr ""
"Project-Id-Version: Drupal 8\\n"
"MIME-Version: 1.0\\n"
"Content-Type: text/plain; charset=Windows-1252\\n"
"Content-Transfer-Encoding: 8bit\\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\\n"

msgid "Swamp"
msgstr "Räme"
EOF;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.