You are here

LoggerTest.php in MongoDB 8.2

File

modules/mongodb_watchdog/tests/src/Unit/LoggerTest.php
View source
<?php

namespace Drupal\Tests\mongodb_watchdog\Unit;

use PHPUnit\Framework\TestCase;

/**
 * Test the ControllerBase mechanisms.
 *
 * @coversDefaultClass \Drupal\mongodb_watchdog\Logger
 *
 * @group mongodb
 */
class LoggerTest extends TestCase {

  /**
   * {@inheritDoc}
   */
  public function setUp() : void {
    require_once __DIR__ . "/../../modules/mongodb_watchdog_test/mongodb_watchdog_test.module";
  }

  /**
   * Test for issue #3219325 about closures stack.
   *
   * @link https://www.drupal.org/project/mongodb/issues/3219325
   * @covers ::enhanceLogEntry
   *
   * @throws \ReflectionException
   */
  public function testEnhanceLogEntry() {
    $backtrace = mongodb_watchdog_test_3219325();
    $logger = new MockLogger();
    $entry = [];
    try {
      $logger
        ->enhanceLogEntry($entry, $backtrace);
    } catch (\ReflectionException $e) {
      $this
        ->fail($e
        ->getMessage());
    }
  }

}

Classes

Namesort descending Description
LoggerTest Test the ControllerBase mechanisms.