WordPress.org

Make WordPress Core

Changeset 278 in tests


Ignore:
Timestamp:
12/22/2009 01:07:24 PM (8 years ago)
Author:
westi
Message:

Add test cases for is_serialized from WP#9930 based on examples from vladimir_kolesnikov and dd32.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wp-testcase/test_includes_functions.php

    r189 r278  
    239239        }
    240240    }
    241 
     241   
     242    function test_is_serialized() {
     243        $this->knownWPBug(9930);
     244        $cases = array(
     245                       serialize("a\nb"),
     246                       serialize(-25),
     247                       serialize(25),
     248                       serialize(false),
     249                       serialize(null),
     250                       serialize(array()),
     251                       serialize(1.1),
     252                       serialize(2.1E+200),
     253                       serialize( (object)array('test' => true, '3', 4) )
     254                       );
     255
     256        foreach ( $cases as $case )
     257            $this->assertTrue( is_serialized($case), "Serialized data: $case" );
     258
     259    }
     260   
    242261}
    243262
Note: See TracChangeset for help on using the changeset viewer.