Problem/Motivation

The message AuditLogEvent class is the core class to communicate events from the interepreters into the registers. It should have a unit test coverage.

Proposed resolution

Write a unit test for this class.

Remaining tasks

User interface changes

API changes

Data model changes

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dagmar created an issue. See original summary.

shawn_smiley’s picture

Assigned: Unassigned » shawn_smiley
shawn_smiley’s picture

Status: Active » Needs review
FileSize
1.98 KB

Base unit test of the AuditLogEvent class provided in the attached patch file.

We should have a separate test for AuditLogLogger->log() which handles creating the AuditLogEvent class.

dagmar’s picture

Status: Needs review » Needs work

Thanks. some minor comments.

  1. +++ b/tests/src/Kernel/AuditLogEventTest.php
    @@ -0,0 +1,42 @@
    +namespace Drupal\Tests\audit_log\Kernel;
    

    Wrong namespace and folder for unit test cases.

  2. +++ b/tests/src/Kernel/AuditLogEventTest.php
    @@ -0,0 +1,42 @@
    +class AuditLogEventTest extends KernelTestBase {
    

    We can use UnitTest instead of Kernel

dagmar’s picture

Status: Needs work » Needs review
FileSize
1.67 KB

Added coverage for getMessagePlaceholders.

  • dagmar committed 97b890d on 8.x-1.x authored by shawn_smiley
    Issue #2863124 by dagmar, shawn_smiley: Write unit tests for...
dagmar’s picture

Status: Needs review » Fixed
shawn_smiley’s picture

Status: Fixed » Needs review
FileSize
757 bytes

Minor update to fix the namespace issue.

dagmar’s picture

Status: Needs review » Fixed

Thanks, I applied the change as part of #2863536: Don't use REQUEST_TIME until Drupal 8.4.0 be ready

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.