Skip to content

Commit 1ebcf7f

Browse files
committed
Add test case for feed_links_extra() when global post is empty
1 parent 4df2101 commit 1ebcf7f

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

tests/phpunit/tests/general/feedLinksExtra.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -634,4 +634,15 @@ public function data_feed_links_extra_should_output_nothing_when_filters_return_
634634
),
635635
);
636636
}
637+
638+
/**
639+
* @ticket 63263
640+
*/
641+
public function test_feed_links_extra_should_not_fail_if_global_post_empty() {
642+
$post_id = self::factory()->post->create();
643+
$this->go_to( get_permalink( $post_id ) );
644+
$GLOBALS['post'] = null;
645+
646+
$this->assertEmpty( get_echo( 'feed_links_extra' ) );
647+
}
637648
}

0 commit comments

Comments
 (0)