File tree Expand file tree Collapse file tree
tests/src/SimpleSAML/Utils Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55namespace SimpleSAML \Utils ;
66
77use SimpleSAML \Configuration ;
8+ use SimpleSAML \Error ;
89
910/**
1011 * Utility class for SimpleSAMLphp configuration management and manipulation.
@@ -49,7 +50,10 @@ public function getSecretSalt(): string
4950 {
5051 $ secretSalt = Configuration::getInstance ()->getString ('secretsalt ' );
5152 if ($ secretSalt === 'defaultsecretsalt ' ) {
52- throw new \InvalidArgumentException ('The "secretsalt" configuration option must be set to a secret value. ' );
53+ throw new Error \CriticalConfigurationError (
54+ 'The "secretsalt" configuration option must be set to a secret value. ' ,
55+ 'config.php ' ,
56+ );
5357 }
5458
5559 return $ secretSalt ;
@@ -74,7 +78,7 @@ public function getConfigDir(): string
7478
7579 if ($ configDirEnv !== false ) {
7680 if (!is_dir ($ configDirEnv )) {
77- throw new \ InvalidArgumentException (
81+ throw new Error \ CriticalConfigurationError (
7882 sprintf (
7983 'Config directory specified by environment variable SIMPLESAMLPHP_CONFIG_DIR is not a ' .
8084 'directory. Given: "%s" ' ,
Original file line number Diff line number Diff line change 66
77use InvalidArgumentException ;
88use PHPUnit \Framework \TestCase ;
9+ use SimpleSAML \Error ;
910use SimpleSAML \Utils ;
1011
1112/**
@@ -89,7 +90,7 @@ public function testInvalidEnvVariableConfigDirThrowsException(): void
8990 $ invalidDir = __DIR__ . '/e9826ad19cbc4f5bf20c0913ffcd2ce6 ' ;
9091 putenv ('SIMPLESAMLPHP_CONFIG_DIR= ' . $ invalidDir );
9192
92- $ this ->expectException (InvalidArgumentException ::class);
93+ $ this ->expectException (Error \CriticalConfigurationError ::class);
9394 $ this ->expectExceptionMessage (
9495 'Config directory specified by environment variable SIMPLESAMLPHP_CONFIG_DIR is not a directory. ' .
9596 'Given: " ' . $ invalidDir . '" '
You can’t perform that action at this time.
0 commit comments