Changeset 59243 for trunk/tests/phpunit/tests/feed/rssEnclosure.php
- Timestamp:
- 10/16/2024 02:17:12 PM (7 weeks ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/feed/rssEnclosure.php
r59241 r59243 2 2 3 3 /** 4 * Test the feed.4 * Tests for the rss_enclosure() function. 5 5 * 6 6 * @group feed 7 * 8 * @covers ::rss_enclosure 7 9 */ 8 class Tests_rssEnclosure extends WP_UnitTestCase { 10 class Tests_Feed_RssEnclosure extends WP_UnitTestCase { 11 9 12 /** 10 13 * @ticket 58798 11 *12 * @covers ::rss_enclosure13 14 */ 14 15 public function test_rss_enclosure_filter() { … … 22 23 add_filter( 23 24 'rss_enclosure', 24 function () {25 static function () { 25 26 return 'filtered_html_link_tag'; 26 27 } … … 32 33 /** 33 34 * @ticket 58798 34 *35 * @covers ::rss_enclosure36 35 */ 37 36 public function test_rss_enclosure_when_global_post_is_empty() { 38 $this->assertEmpty( get_echo( 'rss_enclosure' ), ' It should returnempty when the global post is not set.' );37 $this->assertEmpty( get_echo( 'rss_enclosure' ), 'The output should be empty when the global post is not set.' ); 39 38 } 40 39 41 40 /** 42 41 * @ticket 58798 43 *44 * @covers ::rss_enclosure45 42 */ 46 43 public function test_rss_enclosure_when_enclosure_meta_field_is_empty() { … … 48 45 $GLOBALS['post'] = $post_id; 49 46 50 $this->assertEmpty( get_echo( 'rss_enclosure' ), 'The global post does not have the `enclosure` meta field and should return empty.' );47 $this->assertEmpty( get_echo( 'rss_enclosure' ), 'The output should be empty when the global post does not have the `enclosure` meta field.' ); 51 48 } 52 49 … … 55 52 * 56 53 * @dataProvider data_rss_enclosure_with_multiline_enclosure_string 57 * @covers ::rss_enclosure58 54 */ 59 55 public function test_rss_enclosure_with_multiline_enclosure_string( $enclosure_data, $enclosure_string ) { … … 65 61 $expected = '<enclosure url="' . $enclosure_data['url'] . '" length="' . $enclosure_data['length'] . '" type="' . $enclosure_data['type'] . '" />' . "\n"; 66 62 67 $this->assertSame( $expected, get_echo( 'rss_enclosure' ), ' It should return a valid enclosure tag.' );63 $this->assertSame( $expected, get_echo( 'rss_enclosure' ), 'The output should be a valid enclosure tag.' ); 68 64 } 69 65 … … 71 67 * Data provider for valid enclosure string. 72 68 * 73 * @return array[] .69 * @return array[] 74 70 */ 75 71 public function data_rss_enclosure_with_multiline_enclosure_string() { … … 114 110 * 115 111 * @dataProvider data_rss_enclosure_with_non_valid_enclosure_string 116 * @covers ::rss_enclosure117 112 */ 118 113 public function test_rss_enclosure_with_non_valid_enclosure_string( $enclosure_string ) { … … 122 117 update_post_meta( $post_id, 'enclosure', $enclosure_string ); 123 118 124 $this->assertEmpty( get_echo( 'rss_enclosure' ), ' It should returnempty when the `enclosure` meta field is not saved in a multiline string.' );119 $this->assertEmpty( get_echo( 'rss_enclosure' ), 'The output should be empty when the `enclosure` meta field is not saved in a multiline string.' ); 125 120 } 126 121 … … 128 123 * Data provider for non-valid enclosure string. 129 124 * 130 * @return array[] .125 * @return array[] 131 126 */ 132 127 public function data_rss_enclosure_with_non_valid_enclosure_string() {
Note: See TracChangeset
for help on using the changeset viewer.