silverstripe/silverstripe-framework — pull request #3058 by tractorcow (2014-04-22 03:26:22+00:00)
Title: API Injector supports nesting

Introduced `Injector::nest()` and `Injector::unnest()` to complement the same methodology for `Config`. This is necessary due to environment corruption by `DirectorTest`, which needs to register a service temporarily and restore the original, but does so in such a way that it doesn't correctly restore the original environment. This often causes issues with other test cases which rely on `VersionedRequestFilter`, causing them to fail locally (although Travis seems to get by ok).

Upgrading and Injector documentation has been added, and missing test cases for Config::nest have been added.

Image test was also breaking subsequent tests, for a similar, but not the same reason. A skipped test would result in the Image::$backend being set to null, so now this is only conditionally restored when appropriate.