Fix error handling in loadFromFile methods and update exception types in tests

This commit is contained in:
crazywhalecc
2025-12-10 11:33:39 +08:00
parent bde1440617
commit 020a30315d
5 changed files with 14 additions and 14 deletions

View File

@@ -26,7 +26,7 @@ class ArtifactConfigTest extends TestCase
$reflection = new \ReflectionClass(ArtifactConfig::class);
$property = $reflection->getProperty('artifact_configs');
$property->setAccessible(true);
$property->setValue([]);
$property->setValue(null, []);
}
/** @noinspection PhpExpressionResultUnusedInspection */
@@ -42,7 +42,7 @@ class ArtifactConfigTest extends TestCase
$reflection = new \ReflectionClass(ArtifactConfig::class);
$property = $reflection->getProperty('artifact_configs');
$property->setAccessible(true);
$property->setValue([]);
$property->setValue(null, []);
}
public function testLoadFromDirThrowsExceptionWhenDirectoryDoesNotExist(): void