Skip to content
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

Add testcase for hashtag matching #1362

Merged
merged 3 commits into from
Jan 13, 2025
Merged

Add testcase for hashtag matching #1362

merged 3 commits into from
Jan 13, 2025

Conversation

BentiGorlich
Copy link
Member

This commit contains a lot of prep work for testing activity pub code functionally:

  • create a test only ApHttpClient and create an interface for DI
  • the webfinger code no longer passes a Request object in the event, so we can test it easily

The actual test creates 10 remote users and 10 remote magazines with 1 entry each. Then it creates a local magazine that uses the mbin hashtag to get posts. Then the 10 remote entries are pulled in each containing the mbin hashtag as well, because their magazines are named that way. Afterwards a mastodon style payload is created with an mbin hashtag. If all the posts and entries are created correctly then there are exactly 10 announces as the 10 remote users are subscribed to the local magazine

This commit contains a lot of prep work for testing activity pub code functionally:
- create a test only `ApHttpClient` and create an interface for DI
- the webfinger code no longer passes a `Request` object in the event, so we can test it easily

The actual test creates 10 remote users and 10 remote magazines with 1 entry each. Then it creates a local magazine that uses the `mbin` hashtag to get posts. Then the 10 remote entries are pulled in each containing the `mbin` hashtag as well, because their magazines are named that way. Afterwards a mastodon style payload is created with an `mbin` hashtag. If all the posts and entries are created correctly then there are exactly 10 announces as the 10 remote users are subscribed to the local magazine
@BentiGorlich BentiGorlich added php Pull requests that update PHP code activitypub ActivityPub related issues testing Unit/Functional/Integration test issues and pull requests labels Jan 12, 2025
@BentiGorlich BentiGorlich self-assigned this Jan 12, 2025
@BentiGorlich BentiGorlich enabled auto-merge (squash) January 13, 2025 12:01
@melroy89 melroy89 added this to the v1.7.4 milestone Jan 13, 2025
@BentiGorlich BentiGorlich merged commit 8ead006 into main Jan 13, 2025
7 checks passed
@BentiGorlich BentiGorlich deleted the new/tag-matching-test branch January 13, 2025 12:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
activitypub ActivityPub related issues php Pull requests that update PHP code testing Unit/Functional/Integration test issues and pull requests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants