Changeset 55562 for trunk/tests/phpunit/tests/option/sanitizeOption.php
- Timestamp:
- 03/19/2023 12:03:30 PM (19 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/option/sanitizeOption.php
r54229 r55562 7 7 8 8 /** 9 * @dataProvider data_sanitize_option 10 * 11 * @covers ::sanitize_option 12 */ 13 public function test_sanitize_option( $option_name, $sanitized, $original ) { 14 $this->assertSame( $sanitized, sanitize_option( $option_name, $original ) ); 15 } 16 /** 9 17 * Data provider to test all of the sanitize_option() case 10 18 * … … 13 21 * @return array 14 22 */ 15 public function sanitize_option_provider() {23 public function data_sanitize_option() { 16 24 return array( 17 25 array( 'admin_email', 'mail@example.com', 'mail@example.com' ), … … 87 95 88 96 /** 89 * @dataProvider sanitize_option_provider97 * @dataProvider data_sanitize_option_upload_path 90 98 * 91 99 * @covers ::sanitize_option 92 100 */ 93 public function test_sanitize_option ( $option_name, $sanitized, $original) {94 $this->assertSame( $ sanitized, sanitize_option( $option_name, $original) );101 public function test_sanitize_option_upload_path( $provided, $expected ) { 102 $this->assertSame( $expected, sanitize_option( 'upload_path', $provided ) ); 95 103 } 96 104 97 public function upload_path_provider() {105 public function data_sanitize_option_upload_path() { 98 106 return array( 99 107 array( '<a href="http://www.example.com">Link</a>', 'Link' ), … … 102 110 array( '\path\to\things', '\path\to\things' ), 103 111 ); 104 }105 106 /**107 * @dataProvider upload_path_provider108 *109 * @covers ::sanitize_option110 */111 public function test_sanitize_option_upload_path( $provided, $expected ) {112 $this->assertSame( $expected, sanitize_option( 'upload_path', $provided ) );113 112 } 114 113 … … 134 133 135 134 /** 136 * @dataProvider permalink_structure_provider135 * @dataProvider data_sanitize_option_permalink_structure 137 136 * 138 137 * @covers ::sanitize_option 139 138 * @covers ::get_settings_errors 140 139 */ 141 public function test_sanitize_ permalink_structure( $provided, $expected, $valid ) {140 public function test_sanitize_option_permalink_structure( $provided, $expected, $valid ) { 142 141 global $wp_settings_errors; 143 142 … … 160 159 } 161 160 162 public function permalink_structure_provider() {161 public function data_sanitize_option_permalink_structure() { 163 162 return array( 164 163 array( '', '', true ),
Note: See TracChangeset
for help on using the changeset viewer.