I'm setting up my testing environment and in the docs there is an example for a PHPunit helper file.
In this helper file at the end there is
$di = new FactoryDefault();
DI::reset();
// Add any needed services to the DI here
DI::setDefault($di);
As far as I understand when a DI is created it registers itselft as the default one, so calling DI::getDefault() will always return the last DI created. So why in the example we have DI:reset() and then a DI::setDefault($di) if we didn't create another DI?
It seems kinda redundant. It would only make sense if Di::setDefault() creates a copy of the container instead of having a reference to it. Am I missing something here?