mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
BUGFIX Implementing TestOnly interface in ModelAdminTest to avoid having it included automatically in CMSMenu and hence breaking other tests like LeftAndMainTest.
ENHANCEMENT Filtering out TestOnly classes in CMSMenu::get_cms_classes() git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@85281 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
98ba54ec91
commit
45772748d3
@ -280,10 +280,15 @@ class CMSMenu extends Object implements IteratorAggregate, i18nEntityProvider
|
||||
foreach($subClasses as $key => $className) {
|
||||
// Remove abstract classes and LeftAndMain
|
||||
$classReflection = new ReflectionClass($className);
|
||||
if(!$classReflection->isInstantiable() || 'LeftAndMain' == $className) {
|
||||
if(
|
||||
!$classReflection->isInstantiable()
|
||||
|| 'LeftAndMain' == $className
|
||||
|| ClassInfo::classImplements($className, 'TestOnly')
|
||||
) {
|
||||
unset($subClasses[$key]);
|
||||
}
|
||||
}
|
||||
|
||||
return $subClasses;
|
||||
}
|
||||
|
||||
|
@ -11,7 +11,7 @@ class ModelAdminTest extends FunctionalTest {
|
||||
}
|
||||
}
|
||||
|
||||
class ModelAdminTest_Admin extends ModelAdmin {
|
||||
class ModelAdminTest_Admin extends ModelAdmin implements TestOnly {
|
||||
static $url_segment = 'testadmin';
|
||||
|
||||
public static $managed_models = array(
|
||||
|
Loading…
Reference in New Issue
Block a user