Make WordPress Core

Changeset 30702


Ignore:
Timestamp:
12/02/2014 03:43:17 AM (10 years ago)
Author:
johnbillion
Message:

Update the tests for get_metadata() to reflect the revert in r30701.

See #15030

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/meta.php

    r30140 r30702  
    296296     * @ticket 15030
    297297     */
    298     public function test_get_metadata_with_empty_key_array_value_should_be_unserialized() {
     298    public function test_get_metadata_with_empty_key_array_value() {
    299299        $data = array( 1, 2 );
     300        $value = serialize( $data );
    300301        add_metadata( 'user', $this->author->ID, 'foo', $data );
    301302        $found = get_metadata( 'user', $this->author->ID );
    302303
    303         $this->assertSame( array( $data ), $found['foo'] );
     304        $this->assertSame( array( $value ), $found['foo'] );
    304305    }
    305306
     
    307308     * @ticket 15030
    308309     */
    309     public function test_get_metadata_with_empty_key_object_value_should_be_unserialized() {
     310    public function test_get_metadata_with_empty_key_object_value() {
    310311        $data = new stdClass;
    311312        $data->foo = 'bar';
     313        $value = serialize( $data );
    312314        add_metadata( 'user', $this->author->ID, 'foo', $data );
    313315        $found = get_metadata( 'user', $this->author->ID );
    314316
    315         $this->assertEquals( array( $data ), $found['foo'] );
     317        $this->assertEquals( array( $value ), $found['foo'] );
    316318    }
    317319
     
    319321     * @ticket 15030
    320322     */
    321     public function test_get_metadata_with_empty_key_nested_array_value_should_be_unserialized() {
     323    public function test_get_metadata_with_empty_key_nested_array_value() {
    322324        $data = array(
    323325            array( 1, 2 ),
    324326            array( 3, 4 ),
    325327        );
     328        $value = serialize( $data );
    326329        add_metadata( 'user', $this->author->ID, 'foo', $data );
    327330        $found = get_metadata( 'user', $this->author->ID );
    328331
    329         $this->assertSame( array( $data ), $found['foo'] );
     332        $this->assertSame( array( $value ), $found['foo'] );
    330333    }
    331334
Note: See TracChangeset for help on using the changeset viewer.