Commit 6ed5d819 authored by Jacob Friis Mathiasen's avatar Jacob Friis Mathiasen
Browse files

Issue #3309387 unit testing: Don't pass MockTranslation to TranslatableMarkup...

Issue #3309387 unit testing: Don't pass MockTranslation to TranslatableMarkup when it only breaks tests; and fix a few deprecations.
parent 34f3cdf1
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -30,7 +30,7 @@ class JsonLogDataTest extends UnitTestCase {
   */
  private $data;

  protected function setUp() {
  protected function setUp(): void {
    parent::setUp();
    $config_stub['jsonlog.settings'] = [
      'jsonlog_severity_threshold' => self::DEFAULT_THRESHOLD,
@@ -138,7 +138,7 @@ class JsonLogDataTest extends UnitTestCase {

    $this->data->setSeverity(3);
    $this->assertEquals(
      new TranslatableMarkup('Error', [], [], new MockTranslation()),
      new TranslatableMarkup('Error'),
      $this->data->getSeverity(),
      'LogLevel 3 set to Error.'
    );
@@ -231,7 +231,7 @@ class JsonLogDataTest extends UnitTestCase {
    $site_tags = 'x,y';

    $this->data->setTags($server_tags, $site_tags);
    $this->assertArrayEquals([
    $this->assertEquals([
      'a',
      'b',
      'x',
@@ -244,7 +244,7 @@ class JsonLogDataTest extends UnitTestCase {
    $server_tags = 'a,b';

    $this->data->setTags($server_tags, '');
    $this->assertArrayEquals([
    $this->assertEquals([
      'a',
      'b',
    ], $this->data->getTags(), 'All server tags present.');
@@ -255,7 +255,7 @@ class JsonLogDataTest extends UnitTestCase {
    $site_tags = 'x,y';

    $this->data->setTags('', $site_tags);
    $this->assertArrayEquals([
    $this->assertEquals([
      'x',
      'y',
    ], $this->data->getTags(), 'All site tags present.');
+1 −1
Original line number Diff line number Diff line
@@ -39,7 +39,7 @@ class JsonLogTest extends UnitTestCase {
   */
  private $jsonLogger;

  protected function setUp() {
  protected function setUp(): void {
    parent::setUp();
    $config_stub['jsonlog.settings'] = [
      'jsonlog_severity_threshold' => self::DEFAULT_THRESHOLD,