From 6f7b31a4fe6b4e5867967f4c8fab26bfd46f2e51 Mon Sep 17 00:00:00 2001 From: Paul Bearne Date: Mon, 23 Oct 2023 15:27:27 -0400 Subject: [PATCH 1/7] test for wp_privacy_exports_url --- .../tests/functions/wpPrivacyExportsDir.php | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 tests/phpunit/tests/functions/wpPrivacyExportsDir.php diff --git a/tests/phpunit/tests/functions/wpPrivacyExportsDir.php b/tests/phpunit/tests/functions/wpPrivacyExportsDir.php new file mode 100644 index 0000000000000..e0b994eae6009 --- /dev/null +++ b/tests/phpunit/tests/functions/wpPrivacyExportsDir.php @@ -0,0 +1,43 @@ +assertEquals( 'http://example.org/wp-content/uploads/wp-personal-data-exports/', wp_privacy_exports_url() ); + } + + /** + * @ticket 59709 + */ + public function test_wp_privacy_exports_url_filtered() { + + add_filter( 'wp_privacy_exports_url', array( $this, 'filter_wp_privacy_exports_url' ) ); + + $expected_url = 'https://filtered.com/wp-personal-data-exports/'; + $actual_url = wp_privacy_exports_url(); + $this->assertEquals( $expected_url, $actual_url ); + + remove_filter( 'wp_privacy_exports_url', array( $this, 'filter_wp_privacy_exports_url' ) ); + } + + /** + * Filter for test + * + * @param string $url + */ + public function filter_wp_privacy_exports_url( $url ) { + + return 'https://filtered.com/wp-personal-data-exports/'; + } +} + From 348746b85cd227578df1cc64e7bcf28ac85d7f78 Mon Sep 17 00:00:00 2001 From: Paul Bearne Date: Mon, 23 Oct 2023 15:36:04 -0400 Subject: [PATCH 2/7] test for wp_privacy_exports_dir --- .../tests/functions/wpPrivacyExportsDir.php | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/tests/phpunit/tests/functions/wpPrivacyExportsDir.php b/tests/phpunit/tests/functions/wpPrivacyExportsDir.php index e0b994eae6009..e5ad4e8ed92be 100644 --- a/tests/phpunit/tests/functions/wpPrivacyExportsDir.php +++ b/tests/phpunit/tests/functions/wpPrivacyExportsDir.php @@ -4,40 +4,40 @@ * * @group functions.php * - * @covers ::wp_privacy_exports_url + * @covers ::wp_privacy_exports_dir */# -class Tests_functions_test_wp_privacy_exports_url extends WP_UnitTestCase { +class Tests_functions_wp_privacy_exports_dir extends WP_UnitTestCase { /** - * @ticket 59709 + * @ticket 59710 */ - public function test_wp_privacy_exports_url() { + public function test_wp_privacy_exports_dir() { - $this->assertEquals( 'http://example.org/wp-content/uploads/wp-personal-data-exports/', wp_privacy_exports_url() ); + $this->assertEquals( '/var/www/src/wp-content/uploads/wp-personal-data-exports/', wp_privacy_exports_dir() ); } /** - * @ticket 59709 + * @ticket 59710 */ - public function test_wp_privacy_exports_url_filtered() { + public function test_wp_privacy_exports_dir_filtered() { - add_filter( 'wp_privacy_exports_url', array( $this, 'filter_wp_privacy_exports_url' ) ); + add_filter( 'wp_privacy_exports_dir', array( $this, 'filter_wp_privacy_exports_dir' ) ); - $expected_url = 'https://filtered.com/wp-personal-data-exports/'; - $actual_url = wp_privacy_exports_url(); + $expected_url = '/wp-personal-data-exports-url/'; + $actual_url = wp_privacy_exports_dir(); $this->assertEquals( $expected_url, $actual_url ); - remove_filter( 'wp_privacy_exports_url', array( $this, 'filter_wp_privacy_exports_url' ) ); + remove_filter( 'wp_privacy_exports_dir', array( $this, 'filter_wp_privacy_exports_dir' ) ); } /** * Filter for test * - * @param string $url + * @param string $dir */ - public function filter_wp_privacy_exports_url( $url ) { + public function filter_wp_privacy_exports_dir( $dir ) { - return 'https://filtered.com/wp-personal-data-exports/'; + return '/wp-personal-data-exports-url/'; } } From bcf8d6e9478b6725b69d7328bb886c1be68051ae Mon Sep 17 00:00:00 2001 From: Paul Bearne Date: Thu, 26 Oct 2023 18:14:42 -0400 Subject: [PATCH 3/7] Update wpPrivacyExportsDir.php --- tests/phpunit/tests/functions/wpPrivacyExportsDir.php | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/phpunit/tests/functions/wpPrivacyExportsDir.php b/tests/phpunit/tests/functions/wpPrivacyExportsDir.php index e5ad4e8ed92be..27e0aec996662 100644 --- a/tests/phpunit/tests/functions/wpPrivacyExportsDir.php +++ b/tests/phpunit/tests/functions/wpPrivacyExportsDir.php @@ -40,4 +40,3 @@ public function filter_wp_privacy_exports_dir( $dir ) { return '/wp-personal-data-exports-url/'; } } - From eab491cb73e523585360a2834bbbc57e2b9ce4ad Mon Sep 17 00:00:00 2001 From: Paul Bearne Date: Fri, 26 Jun 2026 14:01:56 -0400 Subject: [PATCH 4/7] Update tests/phpunit/tests/functions/wpPrivacyExportsDir.php Co-authored-by: John Parris --- tests/phpunit/tests/functions/wpPrivacyExportsDir.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/phpunit/tests/functions/wpPrivacyExportsDir.php b/tests/phpunit/tests/functions/wpPrivacyExportsDir.php index 27e0aec996662..b2f1feef7e88f 100644 --- a/tests/phpunit/tests/functions/wpPrivacyExportsDir.php +++ b/tests/phpunit/tests/functions/wpPrivacyExportsDir.php @@ -6,7 +6,7 @@ * * @covers ::wp_privacy_exports_dir */# -class Tests_functions_wp_privacy_exports_dir extends WP_UnitTestCase { +class Tests_Functions_wpPrivacyExportsDir extends WP_UnitTestCase { /** * @ticket 59710 From c5d25c2cfbaf7d4d7bf3c94638ad36393422e327 Mon Sep 17 00:00:00 2001 From: Paul Bearne Date: Fri, 26 Jun 2026 14:02:02 -0400 Subject: [PATCH 5/7] Update tests/phpunit/tests/functions/wpPrivacyExportsDir.php Co-authored-by: John Parris --- tests/phpunit/tests/functions/wpPrivacyExportsDir.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/phpunit/tests/functions/wpPrivacyExportsDir.php b/tests/phpunit/tests/functions/wpPrivacyExportsDir.php index b2f1feef7e88f..ddd1132c854b9 100644 --- a/tests/phpunit/tests/functions/wpPrivacyExportsDir.php +++ b/tests/phpunit/tests/functions/wpPrivacyExportsDir.php @@ -23,9 +23,9 @@ public function test_wp_privacy_exports_dir_filtered() { add_filter( 'wp_privacy_exports_dir', array( $this, 'filter_wp_privacy_exports_dir' ) ); - $expected_url = '/wp-personal-data-exports-url/'; - $actual_url = wp_privacy_exports_dir(); - $this->assertEquals( $expected_url, $actual_url ); + $expected_dir = '/wp-personal-data-exports-dir/'; + $actual_dir = wp_privacy_exports_dir(); + $this->assertEquals( $expected_dir, $actual_dir ); remove_filter( 'wp_privacy_exports_dir', array( $this, 'filter_wp_privacy_exports_dir' ) ); } From d91ec17a82df8f0263b99b432c0efc57c7a184c9 Mon Sep 17 00:00:00 2001 From: Paul Bearne Date: Fri, 26 Jun 2026 14:02:11 -0400 Subject: [PATCH 6/7] Update tests/phpunit/tests/functions/wpPrivacyExportsDir.php Co-authored-by: John Parris --- tests/phpunit/tests/functions/wpPrivacyExportsDir.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/phpunit/tests/functions/wpPrivacyExportsDir.php b/tests/phpunit/tests/functions/wpPrivacyExportsDir.php index ddd1132c854b9..46860696d31df 100644 --- a/tests/phpunit/tests/functions/wpPrivacyExportsDir.php +++ b/tests/phpunit/tests/functions/wpPrivacyExportsDir.php @@ -5,7 +5,7 @@ * @group functions.php * * @covers ::wp_privacy_exports_dir - */# + */ class Tests_Functions_wpPrivacyExportsDir extends WP_UnitTestCase { /** From 29d8c54f8d188eaf45ebc36eaa110143131dc67d Mon Sep 17 00:00:00 2001 From: Paul Bearne Date: Fri, 26 Jun 2026 14:02:19 -0400 Subject: [PATCH 7/7] Update tests/phpunit/tests/functions/wpPrivacyExportsDir.php Co-authored-by: John Parris --- tests/phpunit/tests/functions/wpPrivacyExportsDir.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/phpunit/tests/functions/wpPrivacyExportsDir.php b/tests/phpunit/tests/functions/wpPrivacyExportsDir.php index 46860696d31df..14f61433fd768 100644 --- a/tests/phpunit/tests/functions/wpPrivacyExportsDir.php +++ b/tests/phpunit/tests/functions/wpPrivacyExportsDir.php @@ -37,6 +37,6 @@ public function test_wp_privacy_exports_dir_filtered() { */ public function filter_wp_privacy_exports_dir( $dir ) { - return '/wp-personal-data-exports-url/'; + return '/wp-personal-data-exports-dir/'; } }