Unit testing is testing a class in isolation from other classes. For the unit test of your service you do not need to read anything from the configuration. Just pass the value in your test. In the end, it can potentially work with other values, right?
Of course, if there is any logic / validation around the accepted values, you should probably cover it with tests. Think about how you would do it if you took this value from the configuration. You simply cannot verify the behavior with different values.
If you want to check the correct operation of your application (your classes interact as you expect), use functional tests or an acceptance testing tool (for example, Behat).
Jakub zalas
source share