Skip to content

Commit 3241d78

Browse files
author
Paul Bearne
committed
Replace hardcoded URLs with dynamic get_site_url() calls in theme tests. This ensures greater flexibility and alignment with site configurations during test execution.
1 parent 2eff562 commit 3241d78

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

tests/phpunit/tests/theme/getUploadedHeaderImages.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ public function test_get_uploaded_header_images_caches() {
4242
$expected = array(
4343
$cropped_1_id => array(
4444
'attachment_id' => $cropped_1_id,
45-
'url' => 'http://example.org/wp-content/uploads/foo-cropped-1.png',
46-
'thumbnail_url' => 'http://example.org/wp-content/uploads/foo-cropped-1.png',
45+
'url' => get_site_url() . '/wp-content/uploads/foo-cropped-1.png',
46+
'thumbnail_url' => get_site_url() . '/wp-content/uploads/foo-cropped-1.png',
4747
'alt_text' => '',
4848
'attachment_parent' => $id,
4949
),

tests/phpunit/tests/theme/invalidateHeaderImagesCache.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ public function test_invalidate_header_images_cache_meta_updated() {
4242
$expected = array(
4343
$cropped_1_id => array(
4444
'attachment_id' => $cropped_1_id,
45-
'url' => 'http://example.org/wp-content/uploads/foo-cropped-1.png',
46-
'thumbnail_url' => 'http://example.org/wp-content/uploads/foo-cropped-1.png',
45+
'url' => get_site_url() . '/wp-content/uploads/foo-cropped-1.png',
46+
'thumbnail_url' => get_site_url() . '/wp-content/uploads/foo-cropped-1.png',
4747
'alt_text' => '',
4848
'attachment_parent' => $id,
4949
),
@@ -95,8 +95,8 @@ public function test_invalidate_header_images_cache_meta_deleted() {
9595
$expected = array(
9696
$cropped_1_id => array(
9797
'attachment_id' => $cropped_1_id,
98-
'url' => 'http://example.org/wp-content/uploads/foo-cropped-1.png',
99-
'thumbnail_url' => 'http://example.org/wp-content/uploads/foo-cropped-1.png',
98+
'url' => get_site_url() . '/wp-content/uploads/foo-cropped-1.png',
99+
'thumbnail_url' => get_site_url() . '/wp-content/uploads/foo-cropped-1.png',
100100
'alt_text' => '',
101101
'attachment_parent' => $id,
102102
),

0 commit comments

Comments
 (0)