Changeset 44407 for branches/5.0/tests/phpunit/tests/functions.php
- Timestamp:
- 01/06/2019 08:07:34 PM (7 years ago)
- Location:
- branches/5.0
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
tests/phpunit/tests/functions.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/5.0
- Property svn:mergeinfo changed
/trunk merged: 43658,44406
- Property svn:mergeinfo changed
-
branches/5.0/tests/phpunit/tests/functions.php
r43988 r44407 961 961 962 962 /** 963 * Tests wp_unique_id(). 964 * 965 * @covers ::wp_unique_id 966 * @ticket 44883 967 */ 968 function test_wp_unique_id() { 969 970 // Test without prefix. 971 $ids = array(); 972 for ( $i = 0; $i < 20; $i += 1 ) { 973 $id = wp_unique_id(); 974 $this->assertInternalType( 'string', $id ); 975 $this->assertTrue( is_numeric( $id ) ); 976 $ids[] = $id; 977 } 978 $this->assertEquals( $ids, array_unique( $ids ) ); 979 980 // Test with prefix. 981 $ids = array(); 982 for ( $i = 0; $i < 20; $i += 1 ) { 983 $id = wp_unique_id( 'foo-' ); 984 $this->assertRegExp( '/^foo-\d+$/', $id ); 985 $ids[] = $id; 986 } 987 $this->assertEquals( $ids, array_unique( $ids ) ); 988 } 989 990 /** 963 991 * @ticket 40017 964 992 * @dataProvider _wp_get_image_mime
Note: See TracChangeset
for help on using the changeset viewer.