diff --git a/_config/extensions.yml b/_config/extensions.yml index f681410..ee8e25f 100644 --- a/_config/extensions.yml +++ b/_config/extensions.yml @@ -53,6 +53,10 @@ SilverStripe\FrameworkTest\Elemental\Model\ElementalBehatTestObject: - DNADesign\Elemental\Extensions\ElementalAreasExtension - SilverStripe\FrameworkTest\Elemental\Extension\ElementalBehatTestExtension +SilverStripe\FrameworkTest\Elemental\Model\MultiElementalBehatTestObject: + extensions: + - SilverStripe\FrameworkTest\Elemental\Extension\MultiElementalAreasExtension + BasicElementalPage: extensions: - DNADesign\Elemental\Extensions\ElementalPageExtension @@ -69,7 +73,6 @@ SilverStripe\FrameworkTest\Model\Company: extensions: - SilverStripe\FrameworkTest\LinkField\Extensions\CompanyExtension - --- Only: moduleexists: diff --git a/code/elemental/MultiElementalAreasExtension.php b/code/elemental/MultiElementalAreasExtension.php index 281cf50..43adee9 100644 --- a/code/elemental/MultiElementalAreasExtension.php +++ b/code/elemental/MultiElementalAreasExtension.php @@ -5,6 +5,10 @@ namespace SilverStripe\FrameworkTest\Elemental\Extension; use DNADesign\Elemental\Extensions\ElementalAreasExtension; use DNADesign\Elemental\Models\ElementalArea; +if (!class_exists(ElementalAreasExtension::class)) { + return; +} + /** * This is used to test multiple elemental areas on a page */ diff --git a/code/elemental/MutliElementalBehatTestObject.php b/code/elemental/MutliElementalBehatTestObject.php index 0d3b9f0..66a1536 100644 --- a/code/elemental/MutliElementalBehatTestObject.php +++ b/code/elemental/MutliElementalBehatTestObject.php @@ -3,7 +3,6 @@ namespace SilverStripe\FrameworkTest\Elemental\Model; use SilverStripe\ORM\DataObject; -use SilverStripe\FrameworkTest\Elemental\Extension\MultiElementalAreasExtension; class MultiElementalBehatTestObject extends DataObject { @@ -13,26 +12,22 @@ class MultiElementalBehatTestObject extends DataObject private static $table_name = 'ElementalMultiBehatTestObject'; - private static $extensions = [ - MultiElementalAreasExtension::class, - ]; - - public function canView($member = null) + public function canView($member = null) { return true; } - public function canEdit($member = null) + public function canEdit($member = null) { return true; } - public function canDelete($member = null) + public function canDelete($member = null) { return true; } - public function canCreate($member = null, $context = []) + public function canCreate($member = null, $context = []) { return true; }