From a592d21b045dcf81e1a8f03e73105b6c985a4ccb Mon Sep 17 00:00:00 2001 From: Steve Boyd Date: Tue, 20 Aug 2024 16:03:47 +1200 Subject: [PATCH] API Replace Extension subclasses --- src/Context/FixtureContext.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Context/FixtureContext.php b/src/Context/FixtureContext.php index cafbb138..340d2113 100644 --- a/src/Context/FixtureContext.php +++ b/src/Context/FixtureContext.php @@ -23,7 +23,6 @@ use SilverStripe\Dev\FixtureFactory; use SilverStripe\Dev\YamlFixture; use SilverStripe\ORM\Connect\TempDatabase; -use SilverStripe\ORM\DataExtension; use SilverStripe\ORM\DataObject; use SilverStripe\ORM\DB; use SilverStripe\Security\Group; @@ -704,6 +703,7 @@ public function iAddAnExtensionToTheClass($extension, $class) class_exists($extension ?? '') && is_subclass_of($extension, Extension::class), 'Given extension does not extend Extension' ); + /** @var Extension $extension */ // Add the extension to the CLI context /** @var Extensible $targetClass */ @@ -741,8 +741,8 @@ class_exists($extension ?? '') && is_subclass_of($extension, Extension::class), // Remember to cleanup... $this->activatedConfigFiles[] = $destPath; - // Flush website. We'll need to dev/build too if it's a DataExtension - if (is_subclass_of($extension, DataExtension::class)) { + // Flush website. We'll need to dev/build too if it's a DataObject + if (is_subclass_of($extension->getOwner(), DataObject::class)) { $this->getMainContext()->visit('/dev/build?flush'); } else { $this->getMainContext()->visit('/?flush');