Tests: Use the data_ prefix for various data provider methods.

This aims to bring more consistency to the test suite, as the vast majority of data providers already use that prefix.

Includes moving some data providers next to the tests they are used in.

Follow-up to [55464].

See #57841.

git-svn-id: https://develop.svn.wordpress.org/trunk@55562 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov
2023-03-19 12:03:30 +00:00
parent 81fd448129
commit d1046dc5f3
60 changed files with 680 additions and 679 deletions

View File

@@ -404,7 +404,19 @@ EOF;
$this->assertSame( $test_string, shortcode_unautop( wpautop( $test_string ) ) );
}
public function data_test_strip_shortcodes() {
/**
* @ticket 10326
*
* @dataProvider data_strip_shortcodes
*
* @param string $expected Expected output.
* @param string $content Content to run strip_shortcodes() on.
*/
public function test_strip_shortcodes( $expected, $content ) {
$this->assertSame( $expected, strip_shortcodes( $content ) );
}
public function data_strip_shortcodes() {
return array(
array( 'before', 'before[gallery]' ),
array( 'after', '[gallery]after' ),
@@ -419,18 +431,6 @@ EOF;
);
}
/**
* @ticket 10326
*
* @dataProvider data_test_strip_shortcodes
*
* @param string $expected Expected output.
* @param string $content Content to run strip_shortcodes() on.
*/
public function test_strip_shortcodes( $expected, $content ) {
$this->assertSame( $expected, strip_shortcodes( $content ) );
}
/**
* @ticket 37767
*/