Skip to content

Commit

Permalink
Add real assertion.
Browse files Browse the repository at this point in the history
  • Loading branch information
desrosj committed Nov 11, 2024
1 parent f1cbda3 commit b9e5328
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/wp-includes/feed.php
Original file line number Diff line number Diff line change
Expand Up @@ -842,7 +842,7 @@ function fetch_feed( $url ) {
do_action_ref_array( 'wp_feed_options', array( &$feed, $url ) );

$feed->init();
$feed->set_output_encoding( get_bloginfo(' charset' ) );
$feed->set_output_encoding( get_bloginfo( 'charset' ) );

if ( $feed->error() ) {
return new WP_Error( 'simplepie-error', $feed->error() );
Expand Down
2 changes: 2 additions & 0 deletions tests/phpunit/tests/feed/fetchFeed.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ public function test_empty_charset_does_not_trigger_fatal_error() {
foreach( $feed->get_items( 0, 1 ) as $item ) {

Check failure on line 27 in tests/phpunit/tests/feed/fetchFeed.php

View workflow job for this annotation

GitHub Actions / PHP coding standards / Run coding standards checks

Space after opening control structure is required

Check failure on line 27 in tests/phpunit/tests/feed/fetchFeed.php

View workflow job for this annotation

GitHub Actions / PHP coding standards / Run coding standards checks

No space before opening parenthesis is prohibited

Check failure on line 27 in tests/phpunit/tests/feed/fetchFeed.php

View workflow job for this annotation

GitHub Actions / PHP coding standards / Run coding standards checks

Expected 1 space after FOREACH keyword; 0 found
$content = $item->get_content();
}

$this->assertStringContainsString( '<a href="https://learn.wordpress.org/">Learn WordPress</a> is a learning resource providing workshops, quizzes, courses, lesson plans, and discussion groups so that anyone, from beginners to advanced users, can learn to do more with WordPress.', $content );
}

public function mocked_rss_response() {
Expand Down

0 comments on commit b9e5328

Please sign in to comment.