Changeset 47331 for branches/4.0/tests/phpunit/tests/functions.php
- Timestamp:
- 02/20/2020 05:43:23 PM (5 years ago)
- Location:
- branches/4.0
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/4.0
- Property svn:mergeinfo changed
/trunk merged: 30518,30520,30526,31253-31254,31257
- Property svn:mergeinfo changed
-
branches/4.0/tests/phpunit/tests/functions.php
r45013 r47331 130 130 $this->assertEquals( 'abcdefg.png', wp_unique_filename( $testdir, 'abcde\\fg.png' ), 'Double slashed not removed' ); 131 131 $this->assertEquals( 'abcdefg.png', wp_unique_filename( $testdir, 'abcde\\\fg.png' ), 'Tripple slashed not removed' ); 132 } 133 134 function test_is_serialized() { 135 $cases = array( 136 serialize(null), 137 serialize(true), 138 serialize(false), 139 serialize(-25), 140 serialize(25), 141 serialize(1.1), 142 serialize('this string will be serialized'), 143 serialize("a\nb"), 144 serialize(array()), 145 serialize(array(1,1,2,3,5,8,13)), 146 serialize( (object)array('test' => true, '3', 4) ) 147 ); 148 foreach ( $cases as $case ) 149 $this->assertTrue( is_serialized($case), "Serialized data: $case" ); 150 151 $not_serialized = array( 152 'a string', 153 'garbage:a:0:garbage;', 154 's:4:test;' 155 ); 156 foreach ( $not_serialized as $case ) 157 $this->assertFalse( is_serialized($case), "Test data: $case" ); 132 158 } 133 159
Note: See TracChangeset
for help on using the changeset viewer.