WordPress.org

Make WordPress Core

Opened 3 years ago

Last modified 2 years ago

#34128 new defect (bug)

Tests_Feed_RSS2::test_channel fails when WP_TESTS_TITLE contains an apostrophe

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

Description

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' );

and

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

Change History (4)

#1 @netweb
3 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
2 years ago

Relates to #28816

#3 @stevenkword
2 years ago

  • Keywords needs-unit-tests added

#4 @stevenkword
2 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.