Changeset 49394 for branches/5.2/tests/phpunit/tests/functions.php
- Timestamp:
- 10/29/2020 06:44:12 PM (4 years ago)
- Location:
- branches/5.2
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/5.2
- Property svn:mergeinfo changed
/branches/5.5 (added) merged: 49373-49379,49381 /trunk merged: 49380,49382-49388
- Property svn:mergeinfo changed
-
branches/5.2/tests/phpunit/tests/functions.php
r45270 r49394 237 237 } 238 238 239 240 /** 241 * @dataProvider data_serialize_deserialize_objects 242 */ 243 function test_deserialize_request_utility_filtered_iterator_objects( $value ) { 244 $serialized = maybe_serialize( $value ); 245 if ( is_array( $value ) ) { 246 $deserialized = unserialize( $serialized ); 247 $this->assertNotEquals( reset( $value )->count(), reset( $deserialized )->count() ); 248 } elseif ( get_class( $value ) === 'Requests_Utility_FilteredIterator' ) { 249 $this->assertNotEquals( $value->count(), unserialize( $serialized )->count() ); 250 } else { 251 $this->assertEquals( $value->count(), unserialize( $serialized )->count() ); 252 } 253 } 254 255 function data_serialize_deserialize_objects() { 256 return array( 257 array( new Requests_Utility_FilteredIterator( array( 1 ), 'md5' ) ), 258 array( new Requests_Utility_FilteredIterator( array( 1, 2 ), 'sha1' ) ), 259 array( new ArrayIterator( array( 1, 2, 3 ) ) ), 260 array( array( new Requests_Utility_FilteredIterator( array( 1 ), 'md5' ) ) ), 261 ); 262 } 239 263 240 264 /**
Note: See TracChangeset
for help on using the changeset viewer.