Skip to content

Update some Beatmapset notification tests#13044

Open
notbakaneko wants to merge 1 commit into
ppy:masterfrom
notbakaneko:feature/discussion-reply-test-update
Open

Update some Beatmapset notification tests#13044
notbakaneko wants to merge 1 commit into
ppy:masterfrom
notbakaneko:feature/discussion-reply-test-update

Conversation

@notbakaneko

Copy link
Copy Markdown
Collaborator

Tests only update part of #13008 while I do more checking for splitting the notification options for #13017

  • move dataproviders to top
  • switch to attributes
  • stricter receiverIds checking

@notbakaneko notbakaneko self-assigned this Jun 9, 2026
switch to attributes;
stricter receiverIds checking;
@notbakaneko notbakaneko force-pushed the feature/discussion-reply-test-update branch from 9a33ef3 to b4cad66 Compare June 9, 2026 03:51
Comment thread tests/TestCase.php
protected function receiversInclude(
NewPrivateNotificationEvent|BroadcastNotificationBase $obj,
array|Collection|Model $includes = [],
array|Collection|Model $excludes = []

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there any point in checking this $excludes when the function is already checking that $obj receiver ids are exactly the same as $includes'? Seems rather redundant.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and might as well sort($includeIds); sort($receiverIds); $this->assertSame($includeIds, $receiverIds);...

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's for checking if something is specifically not included but we don't care about the rest; typically they're not both going to be used at the same time, although it should probably be a separate function atp 🤔

I originally wrote this to handle both and then discovered assert(Not)Pushed/Dispatched didn't quite work the way expected :|

@nanaya nanaya Jun 10, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's for checking if something is specifically not included but we don't care about the rest; typically they're not both going to be used at the same time, although it should probably be a separate function atp 🤔

that won't work here though if there's anything in the receiver ids with empty includes passed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants