Automattic / wordpress-activitypub

ActivityPub for WordPress
https://wordpress.org/plugins/activitypub/
MIT License
496 stars 76 forks source link

Add baseline tests for Post::get_type() #991

Closed obenland closed 1 week ago

obenland commented 1 week ago

Allows us to make changes with more confidence in the future.

Fixes #

Proposed changes:

*

Other information:

Testing instructions:

obenland commented 1 week ago

@pfefferle I asked Claude.ai to create some unit tests for the get_type() method as it's written in trunk, so we can compare future changes with those outcomes.

It currently fails for posts without a post format (test_get_type_handles_missing_post_format), probably because of a wrong assumption? Posts with a title, more than 400 char content and no post format should be considered Articles, yes?

pfefferle commented 1 week ago

@obenland I would say so, yes.

obenland commented 1 week ago

Yeah I got a phpcs error for the filename without the pre-pended class-. I'll do a follow up.