Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
psorensen committed Feb 22, 2024
1 parent e6e6ac0 commit 8a90777
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
5 changes: 3 additions & 2 deletions includes/customize-feed.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,9 @@ function bloginfo_rss_name( $output ) {
} else {
$output = $title;
}
$output = apply_filters( 'simple_podcasting_feed_title', $output, $term );
return $output;

return apply_filters( 'simple_podcasting_feed_title', $output, $term );

}
add_filter( 'wp_title_rss', __NAMESPACE__ . '\bloginfo_rss_name' );

Expand Down
14 changes: 7 additions & 7 deletions tests/unit/test-customize-feed.php
Original file line number Diff line number Diff line change
Expand Up @@ -177,20 +177,20 @@ function ( $text, $num_words, $more ) {
}

public function test_rss_title_can_be_filtered() {
$queried_object = (object) array(
'term_id' => 42,
'name' => 'Original Podcast Name'
);
\WP_Mock::userFunction( 'get_queried_object' )
->andReturn(
(object) array(
'term_id' => 42,
'name' => 'Original Podcast Name'
)
);
->andReturn( $queried_object );

\WP_Mock::userFunction( 'get_bloginfo' )
->with( 'name' )
->andReturn( 'Blogname' );


\WP_Mock::onFilter( 'simple_podcasting_feed_title' )
->with( 'Blogname » Original Podcast Name' )
->with( 'Blogname » Original Podcast Name', $queried_object )
->reply( 'Filtered Podcast Title' );

$this->assertEquals(
Expand Down

0 comments on commit 8a90777

Please sign in to comment.