You are here

public function JsonLogDataTest::testMessageWillBeStrippedifStartingWithHtmlMarker in JSONlog 8

Same name and namespace in other branches
  1. 8.2 tests/src/Unit/JsonLogDataTest.php \Drupal\Tests\jsonlog\Unit\JsonLogDataTest::testMessageWillBeStrippedifStartingWithHtmlMarker()
  2. 3.x tests/src/Unit/JsonLogDataTest.php \Drupal\Tests\jsonlog\Unit\JsonLogDataTest::testMessageWillBeStrippedifStartingWithHtmlMarker()

File

tests/src/Unit/JsonLogDataTest.php, line 97

Class

JsonLogDataTest
Unit tests for JsonLogData class

Namespace

Drupal\Tests\jsonlog\Unit

Code

public function testMessageWillBeStrippedifStartingWithHtmlMarker() {
  $this->data = new JsonLogData('test_site_id', 'test_canonical');
  $this
    ->assertNull($this->data
    ->getMessage(), 'Message empty by default');
  $this->data
    ->setMessage('<test logging item');
  $this
    ->assertEmpty($this->data
    ->getMessage(), 'Message gets stripped if starting with <');
  $this
    ->assertEmpty($this->data
    ->getTrunc(), 'Message not truncated');
}