function PoStreamWriterTest::testCloseException

Same name and namespace in other branches
  1. 11.x core/tests/Drupal/Tests/Component/Gettext/PoStreamWriterTest.php \Drupal\Tests\Component\Gettext\PoStreamWriterTest::testCloseException()
  2. 10 core/tests/Drupal/Tests/Component/Gettext/PoStreamWriterTest.php \Drupal\Tests\Component\Gettext\PoStreamWriterTest::testCloseException()
  3. 9 core/tests/Drupal/Tests/Component/Gettext/PoStreamWriterTest.php \Drupal\Tests\Component\Gettext\PoStreamWriterTest::testCloseException()
  4. 8.9.x core/tests/Drupal/Tests/Component/Gettext/PoStreamWriterTest.php \Drupal\Tests\Component\Gettext\PoStreamWriterTest::testCloseException()

Tests close exception.

File

core/tests/Drupal/Tests/Component/Gettext/PoStreamWriterTest.php, line 114

Class

PoStreamWriterTest
Tests Drupal\Component\Gettext\PoStreamWriter.

Namespace

Drupal\Tests\Component\Gettext

Code

public function testCloseException() : void {
  $this->expectException(\Exception::class);
  $this->expectExceptionMessage('Cannot close stream that is not open.');
  $this->poWriter
    ->close();
}

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