<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[58912] trunk/tests/phpunit/tests/privacy: Tests: Bring some consistency to personal data email notification tests.</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { white-space: pre-line; overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta" style="font-size: 105%">
<dt style="float: left; width: 6em; font-weight: bold">Revision</dt> <dd><a style="font-weight: bold" href="https://core.trac.wordpress.org/changeset/58912">58912</a><script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","description":"Review this Commit","action":{"@type":"ViewAction","url":"https://core.trac.wordpress.org/changeset/58912","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>SergeyBiryukov</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2024-08-18 23:43:37 +0000 (Sun, 18 Aug 2024)</dd>
</dl>
<pre style='padding-left: 1em; margin: 2em 0; border-left: 2px solid #ccc; line-height: 1.25; font-size: 105%; font-family: sans-serif'>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 <a href="https://core.trac.wordpress.org/changeset/43291">[43291]</a>, <a href="https://core.trac.wordpress.org/changeset/43499">[43499]</a>, <a href="https://core.trac.wordpress.org/changeset/44535">[44535]</a>.
Props garrett-eclipse, berubenic.
See <a href="https://core.trac.wordpress.org/ticket/46560">#46560</a>.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunktestsphpunittestsprivacywpPrivacySendErasureFulfillmentNotificationphp">trunk/tests/phpunit/tests/privacy/wpPrivacySendErasureFulfillmentNotification.php</a></li>
<li><a href="#trunktestsphpunittestsprivacywpPrivacySendPersonalDataExportEmailphp">trunk/tests/phpunit/tests/privacy/wpPrivacySendPersonalDataExportEmail.php</a></li>
<li><a href="#trunktestsphpunittestsprivacywpPrivacySendRequestConfirmationNotificationphp">trunk/tests/phpunit/tests/privacy/wpPrivacySendRequestConfirmationNotification.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunktestsphpunittestsprivacywpPrivacySendErasureFulfillmentNotificationphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/privacy/wpPrivacySendErasureFulfillmentNotification.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/privacy/wpPrivacySendErasureFulfillmentNotification.php 2024-08-18 11:25:49 UTC (rev 58911)
+++ trunk/tests/phpunit/tests/privacy/wpPrivacySendErasureFulfillmentNotification.php 2024-08-18 23:43:37 UTC (rev 58912)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -99,6 +99,58 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * The function should not send an email when the request ID does not exist.
+ *
+ * @ticket 44234
+ */
+ public function test_should_not_send_email_when_not_a_valid_request_id() {
+ _wp_privacy_send_erasure_fulfillment_notification( 1234567890 );
+
+ $mailer = tests_retrieve_phpmailer_instance();
+
+ $this->assertEmpty( $mailer->mock_sent );
+ }
+
+ /**
+ * The function should not send an email when the ID passed does not correspond to a user request.
+ *
+ * @ticket 44234
+ */
+ public function test_should_not_send_email_when_not_a_user_request() {
+ $post_id = self::factory()->post->create(
+ array(
+ 'post_type' => 'post', // Should be 'user_request'.
+ )
+ );
+
+ _wp_privacy_send_erasure_fulfillment_notification( $post_id );
+ $mailer = tests_retrieve_phpmailer_instance();
+
+ $this->assertEmpty( $mailer->mock_sent );
+ }
+
+ /**
+ * The function should not send an email when the request is not completed.
+ *
+ * @ticket 44234
+ */
+ public function test_should_not_send_email_when_request_not_completed() {
+ wp_update_post(
+ array(
+ 'ID' => self::$request_id,
+ 'post_status' => 'request-confirmed', // Should be 'request-completed'.
+ )
+ );
+
+ _wp_privacy_send_erasure_fulfillment_notification( self::$request_id );
+
+ $mailer = tests_retrieve_phpmailer_instance();
+
+ $this->assertEmpty( $mailer->mock_sent );
+ $this->assertFalse( metadata_exists( 'post', self::$request_id, '_wp_user_notified' ) );
+ }
+
+ /**
</ins><span class="cx" style="display: block; padding: 0 10px"> * The function should send an email when a valid request ID is passed.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 44234
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -283,58 +335,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * The function should not send an email when the request ID does not exist.
- *
- * @ticket 44234
- */
- public function test_should_not_send_email_when_passed_invalid_request_id() {
- _wp_privacy_send_erasure_fulfillment_notification( 1234567890 );
-
- $mailer = tests_retrieve_phpmailer_instance();
-
- $this->assertEmpty( $mailer->mock_sent );
- }
-
- /**
- * The function should not send an email when the ID passed does not correspond to a user request.
- *
- * @ticket 44234
- */
- public function test_should_not_send_email_when_not_user_request() {
- $post_id = self::factory()->post->create(
- array(
- 'post_type' => 'post', // Should be 'user_request'.
- )
- );
-
- _wp_privacy_send_erasure_fulfillment_notification( $post_id );
- $mailer = tests_retrieve_phpmailer_instance();
-
- $this->assertEmpty( $mailer->mock_sent );
- }
-
- /**
- * The function should not send an email when the request is not completed.
- *
- * @ticket 44234
- */
- public function test_should_not_send_email_when_request_not_completed() {
- wp_update_post(
- array(
- 'ID' => self::$request_id,
- 'post_status' => 'request-confirmed', // Should be 'request-completed'.
- )
- );
-
- _wp_privacy_send_erasure_fulfillment_notification( self::$request_id );
-
- $mailer = tests_retrieve_phpmailer_instance();
-
- $this->assertEmpty( $mailer->mock_sent );
- $this->assertFalse( metadata_exists( 'post', self::$request_id, '_wp_user_notified' ) );
- }
-
- /**
</del><span class="cx" style="display: block; padding: 0 10px"> * The function should respect the user locale settings when the site uses the default locale.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 5.2.0
</span></span></pre></div>
<a id="trunktestsphpunittestsprivacywpPrivacySendPersonalDataExportEmailphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/privacy/wpPrivacySendPersonalDataExportEmail.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/privacy/wpPrivacySendPersonalDataExportEmail.php 2024-08-18 11:25:49 UTC (rev 58911)
+++ trunk/tests/phpunit/tests/privacy/wpPrivacySendPersonalDataExportEmail.php 2024-08-18 23:43:37 UTC (rev 58912)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -47,27 +47,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> protected static $admin_user;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * Reset the mocked phpmailer instance before each test method.
- *
- * @since 4.9.6
- */
- public function set_up() {
- parent::set_up();
- reset_phpmailer_instance();
- }
-
- /**
- * Reset the mocked phpmailer instance after each test method.
- *
- * @since 4.9.6
- */
- public function tear_down() {
- reset_phpmailer_instance();
- restore_previous_locale();
- parent::tear_down();
- }
-
- /**
</del><span class="cx" style="display: block; padding: 0 10px"> * Create user request fixtures shared by test methods.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 4.9.6
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -95,31 +74,32 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * The function should send an export link to the requester when the user request is confirmed.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Reset the mocked phpmailer instance before each test method.
+ *
+ * @since 4.9.6
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function test_function_should_send_export_link_to_requester() {
- $exports_url = wp_privacy_exports_url();
- $export_file_name = 'wp-personal-data-file-Wv0RfMnGIkl4CFEDEEkSeIdfLmaUrLsl.zip';
- $export_file_url = $exports_url . $export_file_name;
- update_post_meta( self::$request_id, '_export_file_name', $export_file_name );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function set_up() {
+ parent::set_up();
+ reset_phpmailer_instance();
+ }
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $email_sent = wp_privacy_send_personal_data_export_email( self::$request_id );
- $mailer = tests_retrieve_phpmailer_instance();
-
- $this->assertSame( 'request-confirmed', get_post_status( self::$request_id ) );
- $this->assertSame( self::$requester_email, $mailer->get_recipient( 'to' )->address );
- $this->assertStringContainsString( 'Personal Data Export', $mailer->get_sent()->subject );
- $this->assertStringContainsString( $export_file_url, $mailer->get_sent()->body );
- $this->assertStringContainsString( 'please download it', $mailer->get_sent()->body );
- $this->assertTrue( $email_sent );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * Reset the mocked phpmailer instance after each test method.
+ *
+ * @since 4.9.6
+ */
+ public function tear_down() {
+ reset_phpmailer_instance();
+ restore_previous_locale();
+ parent::tear_down();
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * The function should error when the request ID is invalid.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * The function should error when the request ID does not exist.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 4.9.6
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function test_function_should_error_when_request_id_invalid() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function test_should_return_wp_error_when_not_a_valid_request_id() {
</ins><span class="cx" style="display: block; padding: 0 10px"> $request_id = 0;
</span><span class="cx" style="display: block; padding: 0 10px"> $email_sent = wp_privacy_send_personal_data_export_email( $request_id );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertWPError( $email_sent );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -132,11 +112,29 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * The function should error when the ID passed does not correspond to a user request.
+ *
+ * @since 6.7.0
+ * @ticket 46560
+ */
+ public function test_should_return_wp_error_when_not_a_user_request() {
+ $post_id = self::factory()->post->create(
+ array(
+ 'post_type' => 'post', // Should be 'user_request'.
+ )
+ );
+
+ $email_sent = wp_privacy_send_personal_data_export_email( $post_id );
+ $this->assertWPError( $email_sent );
+ $this->assertSame( 'invalid_request', $email_sent->get_error_code() );
+ }
+
+ /**
</ins><span class="cx" style="display: block; padding: 0 10px"> * The function should error when the email was not sent.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 4.9.6
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function test_return_wp_error_when_send_fails() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function test_should_return_wp_error_when_sending_fails() {
</ins><span class="cx" style="display: block; padding: 0 10px"> add_filter( 'wp_mail_from', '__return_empty_string' ); // Cause `wp_mail()` to return false.
</span><span class="cx" style="display: block; padding: 0 10px"> $email_sent = wp_privacy_send_personal_data_export_email( self::$request_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -145,6 +143,26 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * The function should send an export link to the requester when the user request is confirmed.
+ */
+ public function test_should_send_export_link_to_requester() {
+ $exports_url = wp_privacy_exports_url();
+ $export_file_name = 'wp-personal-data-file-Wv0RfMnGIkl4CFEDEEkSeIdfLmaUrLsl.zip';
+ $export_file_url = $exports_url . $export_file_name;
+ update_post_meta( self::$request_id, '_export_file_name', $export_file_name );
+
+ $email_sent = wp_privacy_send_personal_data_export_email( self::$request_id );
+ $mailer = tests_retrieve_phpmailer_instance();
+
+ $this->assertSame( 'request-confirmed', get_post_status( self::$request_id ) );
+ $this->assertSame( self::$requester_email, $mailer->get_recipient( 'to' )->address );
+ $this->assertStringContainsString( 'Personal Data Export', $mailer->get_sent()->subject );
+ $this->assertStringContainsString( $export_file_url, $mailer->get_sent()->body );
+ $this->assertStringContainsString( 'please download it', $mailer->get_sent()->body );
+ $this->assertTrue( $email_sent );
+ }
+
+ /**
</ins><span class="cx" style="display: block; padding: 0 10px"> * The export expiration should be filterable.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 4.9.6
</span></span></pre></div>
<a id="trunktestsphpunittestsprivacywpPrivacySendRequestConfirmationNotificationphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/privacy/wpPrivacySendRequestConfirmationNotification.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/privacy/wpPrivacySendRequestConfirmationNotification.php 2024-08-18 11:25:49 UTC (rev 58911)
+++ trunk/tests/phpunit/tests/privacy/wpPrivacySendRequestConfirmationNotification.php 2024-08-18 23:43:37 UTC (rev 58912)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -32,11 +32,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * The function should not send emails when the request ID does not exist.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * The function should not send an email when the request ID does not exist.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 43967
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function test_function_should_not_send_email_when_not_a_valid_request_id() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function test_should_not_send_email_when_not_a_valid_request_id() {
</ins><span class="cx" style="display: block; padding: 0 10px"> _wp_privacy_send_request_confirmation_notification( 1234567890 );
</span><span class="cx" style="display: block; padding: 0 10px"> $mailer = tests_retrieve_phpmailer_instance();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -44,14 +44,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * The function should not send emails when the ID passed is not a WP_User_Request.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * The function should not send an email when the ID passed does not correspond to a user request.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 43967
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function test_function_should_not_send_email_when_not_a_wp_user_request() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function test_should_not_send_email_when_not_a_user_request() {
</ins><span class="cx" style="display: block; padding: 0 10px"> $post_id = self::factory()->post->create(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'post_type' => 'post',
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'post_type' => 'post', // Should be 'user_request'.
</ins><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -66,7 +66,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 43967
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function test_function_should_send_email_to_site_admin_when_user_request_confirmed() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function test_should_send_email_to_site_admin_when_user_request_confirmed() {
</ins><span class="cx" style="display: block; padding: 0 10px"> $email = 'export.request.from.unregistered.user@example.com';
</span><span class="cx" style="display: block; padding: 0 10px"> $request_id = wp_create_user_request( $email, 'export_personal_data' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -89,7 +89,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 43967
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function test_function_should_only_send_email_to_site_admin_when_user_request_is_confirmed() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function test_should_only_send_email_to_site_admin_when_user_request_is_confirmed() {
</ins><span class="cx" style="display: block; padding: 0 10px"> $email = 'export.request.from.unregistered.user@example.com';
</span><span class="cx" style="display: block; padding: 0 10px"> $request_id = wp_create_user_request( $email, 'export_personal_data' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -109,7 +109,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 43967
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function test_function_should_only_send_email_once_to_admin_when_user_request_is_confirmed() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function test_should_only_send_email_once_to_admin_when_user_request_is_confirmed() {
</ins><span class="cx" style="display: block; padding: 0 10px"> $email = 'export.request.from.unregistered.user@example.com';
</span><span class="cx" style="display: block; padding: 0 10px"> $request_id = wp_create_user_request( $email, 'export_personal_data' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre>
</div>
</div>
</body>
</html>