mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-04-08 22:54:36 +00:00
General: Rename wp_in_development_mode() to wp_is_development_mode().
This changes the function name for the helper function to check whether the current environment is running with the `WP_DEVELOPMENT_MODE` constant set to be more consistent with similar functions in core, like `wp_is_maintenance_mode()` and `wp_is_recover_mode()`. Props flixos90, swissspidy, costdev, peterwilson, robinwpdeveloper, SergeyBiryukov, joemcgill. See 57487. git-svn-id: https://develop.svn.wordpress.org/trunk@56249 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* @group load.php
|
||||
* @covers ::wp_get_development_mode
|
||||
* @covers ::wp_in_development_mode
|
||||
* @covers ::wp_is_development_mode
|
||||
*/
|
||||
class Test_WP_Get_Development_Mode extends WP_UnitTestCase {
|
||||
|
||||
@@ -46,29 +46,29 @@ class Test_WP_Get_Development_Mode extends WP_UnitTestCase {
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests that `wp_in_development_mode()` returns expected results.
|
||||
* Tests that `wp_is_development_mode()` returns expected results.
|
||||
*
|
||||
* @ticket 57487
|
||||
* @dataProvider data_wp_in_development_mode
|
||||
* @dataProvider data_wp_is_development_mode
|
||||
*/
|
||||
public function test_wp_in_development_mode( $current, $given, $expected ) {
|
||||
public function test_wp_is_development_mode( $current, $given, $expected ) {
|
||||
global $_wp_tests_development_mode;
|
||||
|
||||
$_wp_tests_development_mode = $current;
|
||||
|
||||
if ( $expected ) {
|
||||
$this->assertTrue( wp_in_development_mode( $given ), "{$given} is expected to pass in {$current} mode" );
|
||||
$this->assertTrue( wp_is_development_mode( $given ), "{$given} is expected to pass in {$current} mode" );
|
||||
} else {
|
||||
$this->assertFalse( wp_in_development_mode( $given ), "{$given} is expected to fail in {$current} mode" );
|
||||
$this->assertFalse( wp_is_development_mode( $given ), "{$given} is expected to fail in {$current} mode" );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Data provider that returns test scenarios for the `test_wp_in_development_mode()` method.
|
||||
* Data provider that returns test scenarios for the `test_wp_is_development_mode()` method.
|
||||
*
|
||||
* @return array[]
|
||||
*/
|
||||
public function data_wp_in_development_mode() {
|
||||
public function data_wp_is_development_mode() {
|
||||
return array(
|
||||
'core mode, testing for core' => array(
|
||||
'core',
|
||||
|
||||
Reference in New Issue
Block a user