Since this is a unit test, the configuration is not initialized. This would not really be a unit test if the entire infrastructure were loaded by default.
If you rely on configuration parameters, than explicitly set them in your test:
sfConfig::set('usps_username', 'my username');
With functional tests, this is a little different, as the whole application loads, and you can easily access your configuration.
Edit:
If you look at your cache directory, you will see that all configurations are created in the application directory (cache / frontend / test / config / config_app.yml.php). If you put it in main config / app.yml, just make sure all applications inherit these values. However, you need to run the script in the application context to use them.
In other words: this should be possible, but you will have to initialize the appropriate application configuration instead of the project configuration (therefore frontendConfiguration instead of ProjectConfiguration in your boot file).
However, I believe it is good practice to keep unit tests as independent of the application as possible.
source share