The only real issue with the current setup is it breaks unit tests when we have a different entity selected in config.xml.
The benefit of the call to the $config:uri-base global variable is it cuts down on redundancy. I suppose this is also achieved if the variable is just passed down through the call stack as a parameter? But it is nice to have something as static as the URI base be stored in a globally-available variable.
The argument against this is it makes the unit tests dependent, which goes against the cardinal purpose of a unit test. I'm not sure of a way to rewrite the tests to get around this, so maybe change the implementation of URI base references?
The only real issue with the current setup is it breaks unit tests when we have a different entity selected in config.xml.
The benefit of the call to the
$config:uri-base
global variable is it cuts down on redundancy. I suppose this is also achieved if the variable is just passed down through the call stack as a parameter? But it is nice to have something as static as the URI base be stored in a globally-available variable.The argument against this is it makes the unit tests dependent, which goes against the cardinal purpose of a unit test. I'm not sure of a way to rewrite the tests to get around this, so maybe change the implementation of URI base references?