LoggerChannelFactoryStub->stubGetLogs() fails when no logs are created

Created on 1 February 2023, almost 2 years ago

Problem/Motivation

LoggerChannelFactoryStub->stubGetLogs() fails when no logs are created.

Steps to reproduce

1. Create a logger factory:

    $loggerFactory = TestHelpers::service('logger.factory');

2. Don't add any logs and require a logs:

$logs = $loggerFactory->stubGetLogs();

You will get a fatal error:
Error: Typed property Drupal\test_helpers\Logger\StaticLogger::$logs must not be accessed before initialization

🐛 Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

🇦🇲Armenia murz Yerevan, Armenia

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024