From 8e2697a8b0d05cdc4f683a75b819a6bdc440413e 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 | 5 +++++ code/TestBlogPost.php | 26 ++++++++++++++++++++++++++ code/TestBlogPostExtension.php | 15 +++++++++++++++ code/TestBlogPostsAdmin.php | 17 +++++++++++++++++ 4 files changed, 63 insertions(+) create mode 100644 code/TestBlogPost.php create mode 100644 code/TestBlogPostExtension.php create mode 100644 code/TestBlogPostsAdmin.php diff --git a/_config/extensions.yml b/_config/extensions.yml index 77a5eca..c7cf7e4 100644 --- a/_config/extensions.yml +++ b/_config/extensions.yml @@ -8,6 +8,11 @@ SilverStripe\Assets\File: extensions: - BasicFieldsTestFileExtension +SilverStripe\FrameworkTest\Model\TestBlogPost: + extensions: + - DNADesign\Elemental\Extensions\ElementalAreasExtension + - SilverStripe\FrameworkTest\Extension\TestBlogPostExtension + --- Only: classexists: 'DNADesign\Elemental\Extensions\ElementalPageExtension' diff --git a/code/TestBlogPost.php b/code/TestBlogPost.php new file mode 100644 index 0000000..acd6dd8 --- /dev/null +++ b/code/TestBlogPost.php @@ -0,0 +1,26 @@ +ClassName); + + return Controller::join_links( + $admin->Link($sanitisedClassname), + 'EditForm/field/', + $sanitisedClassname, + 'item', + $this->ID, + ); + } +} diff --git a/code/TestBlogPostExtension.php b/code/TestBlogPostExtension.php new file mode 100644 index 0000000..2a0b5c5 --- /dev/null +++ b/code/TestBlogPostExtension.php @@ -0,0 +1,15 @@ + ElementalArea::class, + ]; + + private static $owns = ['ElementalArea']; +} diff --git a/code/TestBlogPostsAdmin.php b/code/TestBlogPostsAdmin.php new file mode 100644 index 0000000..8d62f4e --- /dev/null +++ b/code/TestBlogPostsAdmin.php @@ -0,0 +1,17 @@ +