mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2025-10-16 12:05:38 +00:00
Tests: Use more descriptive names for wp_rand() test methods.
This aims to clarify the intention of the tests. Follow-up to [53473]. Props mlajo, costdev, acoulombe, azouamauriac, swissspidy, tobifjellner, peterwilsoncc, audrasjb, marekdedic, SergeyBiryukov. See #55194. git-svn-id: https://develop.svn.wordpress.org/trunk@53477 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
342a473e06
commit
e907a66546
@ -356,16 +356,16 @@ class Tests_Pluggable extends WP_UnitTestCase {
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests that wp_rand() returns zero.
|
||||
* Tests that wp_rand() returns zero when `$min` and `$max` are zero.
|
||||
*
|
||||
* @ticket 55194
|
||||
* @dataProvider data_wp_rand_should_return_zero
|
||||
* @dataProvider data_wp_rand_should_return_zero_when_min_and_max_are_zero
|
||||
* @covers ::wp_rand
|
||||
*
|
||||
* @param mixed $min Lower limit for the generated number.
|
||||
* @param mixed $max Upper limit for the generated number.
|
||||
*/
|
||||
public function test_wp_rand_should_return_zero( $min, $max ) {
|
||||
public function test_wp_rand_should_return_zero_when_min_and_max_are_zero( $min, $max ) {
|
||||
$this->assertSame( 0, wp_rand( $min, $max ) );
|
||||
}
|
||||
|
||||
@ -374,7 +374,7 @@ class Tests_Pluggable extends WP_UnitTestCase {
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function data_wp_rand_should_return_zero() {
|
||||
public function data_wp_rand_should_return_zero_when_min_and_max_are_zero() {
|
||||
return array(
|
||||
'min and max as 0' => array(
|
||||
'min' => 0,
|
||||
@ -392,16 +392,16 @@ class Tests_Pluggable extends WP_UnitTestCase {
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests that wp_rand() returns a value between 1 and 99.
|
||||
* Tests that wp_rand() returns a positive integer for both positive and negative input.
|
||||
*
|
||||
* @ticket 55194
|
||||
* @dataProvider data_wp_rand_should_return_between_1_and_99
|
||||
* @dataProvider data_wp_rand_should_return_a_positive_integer
|
||||
* @covers ::wp_rand
|
||||
*
|
||||
* @param int $min Lower limit for the generated number.
|
||||
* @param int $max Upper limit for the generated number.
|
||||
*/
|
||||
public function test_wp_rand_should_return_between_1_and_99( $min, $max ) {
|
||||
public function test_wp_rand_should_return_a_positive_integer( $min, $max ) {
|
||||
$this->assertGreaterThan(
|
||||
0,
|
||||
wp_rand( $min, $max ),
|
||||
@ -420,7 +420,7 @@ class Tests_Pluggable extends WP_UnitTestCase {
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function data_wp_rand_should_return_between_1_and_99() {
|
||||
public function data_wp_rand_should_return_a_positive_integer() {
|
||||
return array(
|
||||
'1 and 99' => array(
|
||||
'min' => 1,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user