Make WordPress Core

Changeset 34759


Ignore:
Timestamp:
10/02/2015 02:05:23 AM (8 years ago)
Author:
jeremyfelt
Message:

Tests: Clarify site option tests storing and retrieving serialized data.

See #28290.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/option/siteOption.php

    r34758 r34759  
    115115    }
    116116
    117     function test_serialized_data() {
     117    function test_site_option_add_and_get_serialized_array() {
    118118        $key = rand_str();
    119119        $value = array( 'foo' => true, 'bar' => true );
     120        add_site_option( $key, $value );
     121        $this->assertEquals( $value, get_site_option( $key ) );
     122    }
    120123
    121         $this->assertTrue( add_site_option( $key, $value ) );
     124    function test_site_option_add_and_get_serialized_object() {
     125        $key = rand_str();
     126        $value = new stdClass();
     127        $value->foo = true;
     128        $value->bar = true;
     129        add_site_option( $key, $value );
    122130        $this->assertEquals( $value, get_site_option( $key ) );
    123 
    124         $value = (object) $value;
    125         $this->assertTrue( update_site_option( $key, $value ) );
    126         $this->assertEquals( $value, get_site_option( $key ) );
    127         $this->assertTrue( delete_site_option( $key ) );
    128131    }
    129132
Note: See TracChangeset for help on using the changeset viewer.