silverstripe/silverstripe-framework — pull request #2017 by tractorcow (2013-05-27 04:48:55+00:00)
Title: BUG Fixed major issue with testing dataobjects that implement TestOnly

Fixed major issue with testing dataobjects that implement TestOnly and extend non-TestOnly dataobjects. Database regeneration would incorrectly populate the ClassName column.

For some reason without this code the "ClassName" DB field generation was very temperamental. The problem is that this value is cached before the test SS_ClassManifest is initiated, meaning that it contained invalid data.

The fix to this is to clear this cache in the test initialisation phase just after adding the new manifest.

@kmayo-ss - This is the cause of that issue that wasted 1 of each of our hours at hackfest!