Skip to content

Commit a6889a7

Browse files
author
Greg Bowler
committed
test: run in separate processes due to static usage
1 parent 00f86ee commit a6889a7

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/LogConfig.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public static function addHandler(LogHandler $handler, string $logLevel = null):
5050
}
5151

5252
private static function ensureAtLeastOneHandler():void {
53-
if(!isset(self::$handlers)) {
53+
if(empty(self::$handlers)) {
5454
self::$handlers = array();
5555
array_push(
5656
self::$handlers,

test/phpunit/LogConfigTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
<?php
22
namespace Gt\Logger\Test;
33

4-
use _HumbugBox373c0874430e\Psr\Log\LogLevel;
54
use Gt\Logger\LogConfig;
65
use Gt\Logger\LogHandler\FileHandler;
76
use Gt\Logger\LogHandler\StdOutHandler;
7+
use Gt\Logger\LogLevel;
88
use PHPUnit\Framework\TestCase;
99

10+
/** @runTestsInSeparateProcesses */
1011
class LogConfigTest extends TestCase {
1112
public function testGetHandlers_returnsDefaultWhenEmpty():void {
1213
$handlerList = LogConfig::getHandlers();

0 commit comments

Comments
 (0)