summaryrefslogtreecommitdiffstats
path: root/tests/Stubs/EventLog.php
blob: 6249423c306659fca1309c57b09e16513b3a88d2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?php

/**
 * Test stub for the legacy global EventLog class.
 *
 * Records info/failure messages so tests can assert on side effects
 * without touching the real logging backend.
 */
class EventLog
{
	public static array $info = [];
	public static array $failure = [];
	public static array $applied = [];

	public static function reset(): void
	{
		self::$info = [];
		self::$failure = [];
		self::$applied = [];
	}

	public static function info(string $message, string $detail = ''): void
	{
		self::$info[] = [$message, $detail];
	}

	public static function failure(string $message): void
	{
		self::$failure[] = $message;
	}

	public static function applyFilterRules(string $category, array $data): void
	{
		self::$applied[] = ['category' => $category, 'data' => $data];
	}
}