Skip to content

Commit d396814

Browse files
committed
update tests
1 parent 8bdb9b3 commit d396814

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

src/Parser/ReportParser.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class ReportParser extends \Aternos\Codex\Parser\Parser
1111
protected const ReportLevel DEFAULT_LEVEL = ReportLevel::INFO;
1212

1313
/**
14-
* @var array<string, array<string>> Regular expression patterns to match log lines to levels
14+
* @var array<int, array<string>> Regular expression patterns to match log lines to levels
1515
*/
1616
protected const array PATTERN = [
1717
ReportLevel::WARNING->value => ["/\s*WARNING: .*$/"],
@@ -35,7 +35,7 @@ public function parse(): void
3535
foreach (static::PATTERN as $level => $patterns) {
3636
foreach ($patterns as $pattern) {
3737
if (preg_match($pattern, $lineString, $matches)) {
38-
$entry->setLevel(ReportLevel::fromString($level));
38+
$entry->setLevel(ReportLevel::from($level));
3939
if (isset($matches[1])) {
4040
$entry->setPrefix($matches[1]);
4141
}

test/data/Vanilla/Forge/Mohist/mohist-crash-report.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
]
2929
},
3030
{
31-
"level": 6,
31+
"level": 4,
3232
"time": null,
3333
"prefix": null,
3434
"lines": [

test/data/Vanilla/Forge/forge-crash-report.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
]
2929
},
3030
{
31-
"level": 6,
31+
"level": 4,
3232
"time": null,
3333
"prefix": null,
3434
"lines": [

test/tests/Logs/AutoLogsTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -688,19 +688,19 @@ public function test_spigot_command_exception(): void
688688
* @return void
689689
* @throws Exception
690690
*/
691-
public function test_spigot_plugin_dependency(): void
691+
public function test_spigot_exception_ticking_world_1_21_4(): void
692692
{
693-
$log = new TestLog('Vanilla/Bukkit/Spigot/spigot-plugin-dependency.log');
693+
$log = new TestLog('Vanilla/Bukkit/Spigot/spigot-exception-ticking-world-1-21-4.log');
694694
$this->assertStringEqualsFile($log->getExpectedPath(), $log->getOutput(), $log->getLogPath());
695695
}
696696

697697
/**
698698
* @return void
699699
* @throws Exception
700700
*/
701-
public function test_spigot_exception_ticking_world_1_21_4(): void
701+
public function test_spigot_plugin_dependency(): void
702702
{
703-
$log = new TestLog('Vanilla/Bukkit/Spigot/spigot-exception-ticking-world-1-21-4.log');
703+
$log = new TestLog('Vanilla/Bukkit/Spigot/spigot-plugin-dependency.log');
704704
$this->assertStringEqualsFile($log->getExpectedPath(), $log->getOutput(), $log->getLogPath());
705705
}
706706

0 commit comments

Comments
 (0)