From 94420d7373dd204e624b908417b57bb3978003b2 Mon Sep 17 00:00:00 2001 From: Sabina Talipova Date: Fri, 6 May 2022 13:59:56 +1200 Subject: [PATCH] New classes for testing ElementalArea in DataObject --- _config/extensions.yml | 9 +++++-- code/elemental/ElementalBehatTestAdmin.php | 17 ++++++++++++ .../elemental/ElementalBehatTestExtension.php | 15 +++++++++++ code/elemental/ElementalBehatTestObject.php | 26 +++++++++++++++++++ 4 files changed, 65 insertions(+), 2 deletions(-) create mode 100644 code/elemental/ElementalBehatTestAdmin.php create mode 100644 code/elemental/ElementalBehatTestExtension.php create mode 100644 code/elemental/ElementalBehatTestObject.php diff --git a/_config/extensions.yml b/_config/extensions.yml index 77a5eca..5fdbfdc 100644 --- a/_config/extensions.yml +++ b/_config/extensions.yml @@ -7,11 +7,16 @@ SilverStripe\ORM\DataObject: SilverStripe\Assets\File: extensions: - BasicFieldsTestFileExtension - + --- Only: - classexists: 'DNADesign\Elemental\Extensions\ElementalPageExtension' + moduleexists: 'dnadesign/silverstripe-elemental' --- SilverStripe\FrameworkTest\Model\TestPage: extensions: - DNADesign\Elemental\Extensions\ElementalPageExtension + +SilverStripe\FrameworkTest\Elemental\Model\ElementalBehatTestObject: + extensions: + - DNADesign\Elemental\Extensions\ElementalAreasExtension + - SilverStripe\FrameworkTest\Elemental\Extension\ElementalBehatTestExtension diff --git a/code/elemental/ElementalBehatTestAdmin.php b/code/elemental/ElementalBehatTestAdmin.php new file mode 100644 index 0000000..f251be2 --- /dev/null +++ b/code/elemental/ElementalBehatTestAdmin.php @@ -0,0 +1,17 @@ + ElementalArea::class, + ]; + + private static $owns = ['ElementalArea']; +} diff --git a/code/elemental/ElementalBehatTestObject.php b/code/elemental/ElementalBehatTestObject.php new file mode 100644 index 0000000..075308a --- /dev/null +++ b/code/elemental/ElementalBehatTestObject.php @@ -0,0 +1,26 @@ +ClassName); + + return Controller::join_links( + $admin->Link($sanitisedClassname), + 'EditForm/field/', + $sanitisedClassname, + 'item', + $this->ID, + ); + } +}