public function JsonLogDataTest::testMessageWillNotContainNullByte in JSONlog 8
Same name and namespace in other branches
- 8.2 tests/src/Unit/JsonLogDataTest.php \Drupal\Tests\jsonlog\Unit\JsonLogDataTest::testMessageWillNotContainNullByte()
- 3.x tests/src/Unit/JsonLogDataTest.php \Drupal\Tests\jsonlog\Unit\JsonLogDataTest::testMessageWillNotContainNullByte()
File
- tests/
src/ Unit/ JsonLogDataTest.php, line 106
Class
- JsonLogDataTest
- Unit tests for JsonLogData class
Namespace
Drupal\Tests\jsonlog\UnitCode
public function testMessageWillNotContainNullByte() {
$this->data = new JsonLogData('test_site_id', 'test_canonical');
$this
->assertNull($this->data
->getMessage(), 'Message empty by default');
$this->data
->setMessage('test logging ' . "\0" . ' item');
$this
->assertEquals('test logging _NUL_ item', $this->data
->getMessage(), 'Message gets logged without null byte.');
$this
->assertEmpty($this->data
->getTrunc(), 'Message not truncated');
}