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 PackageConfigTest extends TestCase
$reflection = new \ReflectionClass(PackageConfig::class);
$property = $reflection->getProperty('package_configs');
$property->setAccessible(true);
$property->setValue([]);
$property->setValue(null, []);
}
protected function tearDown(): void
@@ -41,7 +41,7 @@ class PackageConfigTest extends TestCase
$reflection = new \ReflectionClass(PackageConfig::class);
$property = $reflection->getProperty('package_configs');
$property->setAccessible(true);
$property->setValue([]);
$property->setValue(null, []);
}
public function testLoadFromDirThrowsExceptionWhenDirectoryDoesNotExist(): void