WordPress/wp-includes/version.php
Sergey Biryukov 6e12ff3b89 Tests: Add a helper method for for creating named data providers in WP_UnitTestCase_Base.
This introduces a new test helper function which allows for turning a single-level array containing text strings into a data provider with named data sets, where the value of the data set will also be used as the name of the data set.

The function contains safeguards to ensure that it is only used with data compatible with this principle and will throw generic PHP exceptions when the data is incompatible. These type of exceptions will be displayed before the tests even start running and will stop the test run when they occur.

While generally speaking, all test cases ''should'' extend the base `WP_UnitTestCase_Base` class, this is still made a `public static` method to allow for a test, which by exception directly extends the PHPUnit base `TestCase` or the `PHPUnit_Adapter_TestCase`, to also be able to use this method.

Typical usage of this method:
{{{
public function data_provider_for_test_name() {
	$array = array(
		'value1',
		'value2',
	);

	return $this->text_array_to_dataprovider( $array );
}
}}}
The returned result will look like:
{{{
array(
	'value1' => array( 'value1' ),
	'value2' => array( 'value2' ),
)
}}}

Props jrf, hellofromTonya, adamsilverstein.
See #55652.
Built from https://develop.svn.wordpress.org/trunk@53521


git-svn-id: http://core.svn.wordpress.org/trunk@53110 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-18 21:30:13 +00:00

48 lines
939 B
PHP

<?php
/**
* WordPress Version
*
* Contains version information for the current WordPress release.
*
* @package WordPress
* @since 1.2.0
*/
/**
* The WordPress version string.
*
* Holds the current version number for WordPress core. Used to bust caches
* and to enable development mode for scripts when running from the /src directory.
*
* @global string $wp_version
*/
$wp_version = '6.1-alpha-53521';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
*
* @global int $wp_db_version
*/
$wp_db_version = 53496;
/**
* Holds the TinyMCE version.
*
* @global string $tinymce_version
*/
$tinymce_version = '49110-20201110';
/**
* Holds the required PHP version.
*
* @global string $required_php_version
*/
$required_php_version = '5.6.20';
/**
* Holds the required MySQL version.
*
* @global string $required_mysql_version
*/
$required_mysql_version = '5.0';