Make WordPress Core

Opened 6 years ago

Last modified 4 months ago

#46560 assigned enhancement

Personal Data Export email unit tests found in erasure fulfillment

Reported by: garrett-eclipse's profile garrett-eclipse Owned by: berubenic's profile berubenic
Milestone: Future Release Priority: low
Severity: normal Version: 4.9.6
Component: Privacy Keywords: has-patch has-unit-tests
Focuses: Cc:

Description

Hello,

While working on #44721 and #46056 I found there's some unit tests for the erasure fulfillment email that aren't covered in the data export email. Specifically, the test on post_type and post_status found here;
https://github.com/WordPress/wordpress-develop/blob/5.1.1/tests/phpunit/tests/privacy/wpPrivacySendErasureFulfillmentNotification.php#L240-L277

We should be checking these to have consistent coverage between unit test suites for the two similar emails.

Cheers

Change History (7)

#1 @desrosj
7 months ago

  • Keywords needs-patch good-first-bug needs-unit-tests added
  • Milestone changed from Awaiting Review to Future Release
  • Priority changed from normal to low

Marking this as a good-first-bug for someone looking to get their feet wet writing unit tests.

For a starter guide, there's a page in the Core Handbook detailing writing tests.

#2 @pbearne
5 months ago

  • Owner set to beruberic
  • Status changed from new to assigned

This ticket was mentioned in PR #7014 on WordPress/wordpress-develop by @berubenic.


5 months ago
#3

  • Keywords has-patch has-unit-tests added; needs-patch needs-unit-tests removed

#4 @pbearne
5 months ago

  • Owner changed from beruberic to berubenic

#5 @SergeyBiryukov
4 months ago

In 58912:

Tests: Bring some consistency to personal data email notification tests.

Includes:

  • Adding a test for wp_privacy_send_personal_data_export_email() to verify the user_request post type.
  • Reordering some pre-existing tests to check the request ID and post type first.

Follow-up to [43291], [43499], [44535].

Props garrett-eclipse, berubenic.
See #46560.

@SergeyBiryukov commented on PR #7014:


4 months ago
#6

Thanks for the PR! Merged in r58912.

#7 in reply to: ↑ description @SergeyBiryukov
4 months ago

  • Keywords good-first-bug removed

Replying to garrett-eclipse:

While working on #44721 and #46056 I found there's some unit tests for the erasure fulfillment email that aren't covered in the data export email. Specifically, the test on post_type and post_status

Thanks for the ticket! A test for post_type of the request is now added in [58912].

It appears that wp_privacy_send_personal_data_export_email() does not perform any checks on the post_status of the request, so the latter part could use some further investigation.

Note: See TracTickets for help on using tickets.