function PoStreamReaderTest::testOpeningFileError
Same name and namespace in other branches
- 11.x core/tests/Drupal/Tests/Component/Gettext/PoStreamReaderTest.php \Drupal\Tests\Component\Gettext\PoStreamReaderTest::testOpeningFileError()
Validates that calling open with an invalid URI throws an exception.
File
-
core/
tests/ Drupal/ Tests/ Component/ Gettext/ PoStreamReaderTest.php, line 22
Class
- PoStreamReaderTest
- Unit tests for the Gettext PO file header handling features.
Namespace
Drupal\Tests\Component\GettextCode
public function testOpeningFileError() : void {
$reader = new PoStreamReader();
$reader->setURI('fake');
$this->expectException(\RuntimeException::class);
$this->expectExceptionMessage('Cannot open stream for uri fake');
$reader->open();
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.