Changeset 59564 for trunk/tests/phpunit/tests/admin/includesTemplate.php
- Timestamp:
- 12/28/2024 10:08:19 PM (17 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/admin/includesTemplate.php
r58136 r59564 242 242 243 243 /** 244 * @ticket 62746 245 * 246 * @param array $extra_args Extra arguments to pass to function `add_settings_section()`. 247 * @param array $expected_section_data Expected set of section data. 248 * @param string $expected_before_section_html Expected HTML markup to be rendered before the settings section. 249 * @param string $expected_after_section_html Expected HTML markup to be rendered after the settings section. 250 * 251 * @covers ::add_settings_section 252 * @covers ::do_settings_sections 253 * 254 * @dataProvider data_extra_args_for_add_settings_section 255 */ 256 public function test_add_settings_section_without_any_fields( $extra_args, $expected_section_data, $expected_before_section_html, $expected_after_section_html ) { 257 add_settings_section( 'test-section', 'Section title', '__return_false', 'test-page', $extra_args ); 258 259 ob_start(); 260 do_settings_sections( 'test-page' ); 261 $output = ob_get_clean(); 262 263 $this->assertStringContainsString( $expected_before_section_html, $output, 'Test page output does not contain the custom markup to be placed before the section.' ); 264 $this->assertStringContainsString( $expected_after_section_html, $output, 'Test page output does not contain the custom markup to be placed after the section.' ); 265 } 266 267 /** 244 268 * Data provider for `test_add_settings_section_with_extra_args()`. 245 269 *
Note: See TracChangeset
for help on using the changeset viewer.