-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MNT Fix unit test #215
MNT Fix unit test #215
Conversation
810735f
to
a578de3
Compare
@@ -24,4 +24,3 @@ public function objectsToDelete($context) | |||
return []; | |||
} | |||
} | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Linting fix
@@ -246,7 +250,8 @@ public function testStaticPublishingTriggerOnExtension(): void | |||
/** @var QueuedJobsTestService $service */ | |||
$service = QueuedJobService::singleton(); | |||
|
|||
$dataObject = DataObjectNoTrigger::create()->write(); | |||
$dataObject = DataObjectNoTrigger::create(); | |||
$dataObject->write(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
->write()
returns an int, so we cannot chain it
I have no idea how this unit test used to pass
@@ -7,9 +7,10 @@ | |||
|
|||
class DataObjectNoTrigger extends DataObject implements TestOnly | |||
{ | |||
private static $table_name = 'StaticPublishQueue_DataObjectNoTrigger'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've created silverstripe/silverstripe-standards#15 to add a phpstan rule to resolve these going forward
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. wild that this wasn't failing before.
Issue silverstripe/.github#357
Fixes https://github.com/creative-commoners/recipe-kitchen-sink/actions/runs/12879104438/job/35906085673#step:12:105
1) SilverStripe\StaticPublishQueue\Test\Extension\Engine\SiteTreePublishingEngineTest::testStaticPublishingTriggerOnExtension SilverStripe\ORM\Connect\DatabaseException: Couldn't run query: ...
The unit test SiteTreePublishingEngineTest::testStaticPublishingTriggerOnExtension() doesn't exist on the latest minor branch 6.2, so targeting the 6 branch is correct