Ticket #55194: 55194.3.diff
File 55194.3.diff, 1.4 KB (added by , 2 years ago) |
---|
-
tests/phpunit/tests/pluggable/wpRand.php
7 7 class Tests_Pluggable_wpRand extends WP_UnitTestCase { 8 8 9 9 /** 10 * Tests that wp_rand() returns a positive integer for both positive and negative input.10 * Tests that wp_rand() returns a non-negative integer for both positive and negative input. 11 11 * 12 12 * @ticket 55194 13 * @dataProvider data_wp_rand_should_return_a_ positive_integer13 * @dataProvider data_wp_rand_should_return_a_non_negative_integer 14 14 * 15 15 * @param int $min Lower limit for the generated number. 16 16 * @param int $max Upper limit for the generated number. 17 17 */ 18 public function test_wp_rand_should_return_a_ positive_integer( $min, $max ) {19 $this->assertGreaterThan (18 public function test_wp_rand_should_return_a_non_negative_integer( $min, $max ) { 19 $this->assertGreaterThanOrEqual( 20 20 0, 21 21 wp_rand( $min, $max ), 22 'The value was not greater than 0'22 'The value was not greater than or equal 0' 23 23 ); 24 24 25 25 $this->assertLessThan( … … 34 34 * 35 35 * @return array 36 36 */ 37 public function data_wp_rand_should_return_a_ positive_integer() {37 public function data_wp_rand_should_return_a_non_negative_integer() { 38 38 return array( 39 39 '1 and 99' => array( 40 40 'min' => 1,