From a578de39df166ce0e824d9fbd211ac77c69fde1c Mon Sep 17 00:00:00 2001 From: Steve Boyd Date: Tue, 21 Jan 2025 16:59:31 +1300 Subject: [PATCH] MNT Fix unit test --- .../php/Extension/Engine/SiteTreePublishingEngineTest.php | 7 ++++++- .../php/StaticPublisherTest/Model/DataObjectNoTrigger.php | 3 ++- .../php/StaticPublisherTest/Model/ExtensionAddsTrigger.php | 1 - 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/tests/php/Extension/Engine/SiteTreePublishingEngineTest.php b/tests/php/Extension/Engine/SiteTreePublishingEngineTest.php index 32a52e0..f6a4281 100644 --- a/tests/php/Extension/Engine/SiteTreePublishingEngineTest.php +++ b/tests/php/Extension/Engine/SiteTreePublishingEngineTest.php @@ -26,6 +26,10 @@ class SiteTreePublishingEngineTest extends SapphireTest { protected static $fixture_file = 'SiteTreePublishingEngineTest.yml'; + protected static $extra_dataobjects = [ + DataObjectNoTrigger::class, + ]; + protected static $required_extensions = [ SiteTree::class => [ PublishableSiteTree::class, @@ -246,7 +250,8 @@ public function testStaticPublishingTriggerOnExtension(): void /** @var QueuedJobsTestService $service */ $service = QueuedJobService::singleton(); - $dataObject = DataObjectNoTrigger::create()->write(); + $dataObject = DataObjectNoTrigger::create(); + $dataObject->write(); $dataObject->publishRecursive(); $jobs = $service->getJobs(); diff --git a/tests/php/StaticPublisherTest/Model/DataObjectNoTrigger.php b/tests/php/StaticPublisherTest/Model/DataObjectNoTrigger.php index fa7021e..a1dddbc 100644 --- a/tests/php/StaticPublisherTest/Model/DataObjectNoTrigger.php +++ b/tests/php/StaticPublisherTest/Model/DataObjectNoTrigger.php @@ -7,9 +7,10 @@ class DataObjectNoTrigger extends DataObject implements TestOnly { + private static $table_name = 'StaticPublishQueue_DataObjectNoTrigger'; + public function AbsoluteLink() { return 'http://example.com/subpage/dataobject-1'; } } - diff --git a/tests/php/StaticPublisherTest/Model/ExtensionAddsTrigger.php b/tests/php/StaticPublisherTest/Model/ExtensionAddsTrigger.php index d0bd7c2..f8de405 100644 --- a/tests/php/StaticPublisherTest/Model/ExtensionAddsTrigger.php +++ b/tests/php/StaticPublisherTest/Model/ExtensionAddsTrigger.php @@ -24,4 +24,3 @@ public function objectsToDelete($context) return []; } } -