Changeset 49391 for branches/5.4/tests/phpunit/tests/functions.php
- Timestamp:
- 10/29/2020 06:39:14 PM (4 years ago)
- Location:
- branches/5.4
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/5.4
- Property svn:mergeinfo changed
/branches/5.5 (added) merged: 49373-49379,49381 /trunk merged: 49380,49382-49388
- Property svn:mergeinfo changed
-
branches/5.4/tests/phpunit/tests/functions.php
r47122 r49391 255 255 $this->assertFalse( is_serialized( $case ), "Test data: $case" ); 256 256 } 257 } 258 259 /** 260 * @dataProvider data_serialize_deserialize_objects 261 */ 262 function test_deserialize_request_utility_filtered_iterator_objects( $value ) { 263 $serialized = maybe_serialize( $value ); 264 if ( is_array( $value ) ) { 265 $deserialized = unserialize( $serialized ); 266 $this->assertNotEquals( reset( $value )->count(), reset( $deserialized )->count() ); 267 } elseif ( get_class( $value ) === 'Requests_Utility_FilteredIterator' ) { 268 $this->assertNotEquals( $value->count(), unserialize( $serialized )->count() ); 269 } else { 270 $this->assertEquals( $value->count(), unserialize( $serialized )->count() ); 271 } 272 } 273 274 function data_serialize_deserialize_objects() { 275 return array( 276 array( new Requests_Utility_FilteredIterator( array( 1 ), 'md5' ) ), 277 array( new Requests_Utility_FilteredIterator( array( 1, 2 ), 'sha1' ) ), 278 array( new ArrayIterator( array( 1, 2, 3 ) ) ), 279 array( array( new Requests_Utility_FilteredIterator( array( 1 ), 'md5' ) ) ), 280 ); 257 281 } 258 282
Note: See TracChangeset
for help on using the changeset viewer.