mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Excluded TestOnly classes from field conflict check
This commit is contained in:
parent
55cb8f37ea
commit
2a59b1b387
@ -12,6 +12,7 @@ use SilverStripe\Core\Injector\Injector;
|
|||||||
use SilverStripe\Core\Resettable;
|
use SilverStripe\Core\Resettable;
|
||||||
use SilverStripe\Dev\Debug;
|
use SilverStripe\Dev\Debug;
|
||||||
use SilverStripe\Dev\Deprecation;
|
use SilverStripe\Dev\Deprecation;
|
||||||
|
use SilverStripe\Dev\TestOnly;
|
||||||
use SilverStripe\Forms\FieldList;
|
use SilverStripe\Forms\FieldList;
|
||||||
use SilverStripe\Forms\FormField;
|
use SilverStripe\Forms\FormField;
|
||||||
use SilverStripe\Forms\FormScaffolder;
|
use SilverStripe\Forms\FormScaffolder;
|
||||||
@ -3453,7 +3454,7 @@ class DataObject extends ViewableData implements DataObjectInterface, i18nEntity
|
|||||||
|
|
||||||
// Sanity check for fields that conflict with parent
|
// Sanity check for fields that conflict with parent
|
||||||
foreach (array_keys($fields) as $fieldName) {
|
foreach (array_keys($fields) as $fieldName) {
|
||||||
if (method_exists(get_parent_class($this), $fieldName)) {
|
if (method_exists(get_parent_class($this), $fieldName) && !($this instanceof TestOnly)) {
|
||||||
throw new LogicException(sprintf(
|
throw new LogicException(sprintf(
|
||||||
'\'%s\' has a $db field named "%s" that coincides with an inherited method of the same name.',
|
'\'%s\' has a $db field named "%s" that coincides with an inherited method of the same name.',
|
||||||
static::class,
|
static::class,
|
||||||
|
Loading…
Reference in New Issue
Block a user