Changeset 48881 for trunk/tests/phpunit/tests/rest-api.php
- Timestamp:
- 08/27/2020 02:55:39 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/rest-api.php
r48555 r48881 1920 1920 1921 1921 /** 1922 * @ticket 51146 1923 * 1924 * @dataProvider _dp_rest_is_integer 1925 * 1926 * @param bool $expected Expected result of the check. 1927 * @param mixed $value The value to check. 1928 */ 1929 public function test_rest_is_integer( $expected, $value ) { 1930 $is_integer = rest_is_integer( $value ); 1931 1932 if ( $expected ) { 1933 $this->assertTrue( $is_integer ); 1934 } else { 1935 $this->assertFalse( $is_integer ); 1936 } 1937 } 1938 1939 public function _dp_rest_is_integer() { 1940 return array( 1941 array( 1942 true, 1943 1, 1944 ), 1945 array( 1946 true, 1947 '1', 1948 ), 1949 array( 1950 true, 1951 0, 1952 ), 1953 array( 1954 true, 1955 -1, 1956 ), 1957 array( 1958 true, 1959 '05', 1960 ), 1961 array( 1962 false, 1963 'garbage', 1964 ), 1965 array( 1966 false, 1967 5.5, 1968 ), 1969 array( 1970 false, 1971 '5.5', 1972 ), 1973 array( 1974 false, 1975 array(), 1976 ), 1977 array( 1978 false, 1979 true, 1980 ), 1981 ); 1982 } 1983 1984 /** 1922 1985 * @ticket 50300 1923 1986 * … … 2019 2082 array( 'array', 'string' ), 2020 2083 ), 2084 array( 2085 'string', 2086 'hello', 2087 array( 'integer', 'string' ), 2088 ), 2021 2089 ); 2022 2090 }
Note: See TracChangeset
for help on using the changeset viewer.