Make WordPress Core

Opened 4 years ago

Last modified 8 months ago

#34128 new defect (bug)

Tests_Feed_RSS2::test_channel fails when WP_TESTS_TITLE contains an apostrophe

Reported by: miqrogroove Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Feeds Keywords: needs-patch needs-unit-tests
Focuses: Cc:
PR Number:


If the site configuration contains an apostrophe in the site title, the test_channel unit fails.

1) Tests_Feed_RSS2::test_channel
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'Rob's Test Blog'
+'Rob's Test Blog'

The happens with either of the following configurations:

define( 'WP_TESTS_TITLE', 'Rob\'s Test Blog' );


define( 'WP_TESTS_TITLE', 'Rob's Test Blog' );

Change History (4)

#1 @netweb
4 years ago

  • Keywords needs-patch added
  • Milestone changed from Awaiting Review to Future Release
  • Summary changed from Tests_Feed_RSS2::test_channel Failure to Tests_Feed_RSS2::test_channel fails when WP_TESTS_TITLE contains an apostrophe

Sounds reasonable, kind of surprised more tests didn't fail

#2 @stevenkword
4 years ago

Relates to #28816

#3 @stevenkword
4 years ago

  • Keywords needs-unit-tests added

#4 @stevenkword
4 years ago

I did a little digging and believe the problem is in the xml_to_array() method of /tests/phpunit/includes/utils.php. This function is taking the encoded HTML entities and translating them back into unencoded characters.

Note: See TracTickets for help on using tickets.