Changeset 43036 for trunk/tests/phpunit/tests/compat.php
- Timestamp:
- 04/30/2018 04:14:30 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/compat.php
r43034 r43036 231 231 ); 232 232 } 233 234 /** 235 * @ticket 43619 236 */ 237 function test_is_iterable_availability() { 238 $this->assertTrue( function_exists( 'is_iterable' ) ); 239 } 240 241 /** 242 * Test is_iterable() polyfill. 243 * 244 * @ticket 43619 245 * 246 * @dataProvider iterable_variable_test_data 247 */ 248 function test_is_iterable_functionality( $variable, $is_iterable ) { 249 $this->assertEquals( is_iterable( $variable ), $is_iterable ); 250 } 251 252 /** 253 * Data provider for test_is_iterable_functionality(). 254 * 255 * @ticket 43619 256 * 257 * @return array { 258 * @type array { 259 * @type mixed $variable Variable to check. 260 * @type bool $is_iterable The expected return value of PHP 7.1 is_iterable() function. 261 * } 262 * } 263 */ 264 public function iterable_variable_test_data() { 265 return array( 266 array( array(), true ), 267 array( array( 1, 2, 3 ), true ), 268 array( new ArrayIterator( array( 1, 2, 3 ) ), true ), 269 array( 1, false ), 270 array( 3.14, false ), 271 array( new stdClass(), false ), 272 ); 273 } 233 274 } 234 275
Note: See TracChangeset
for help on using the changeset viewer.