Make WordPress Core

Changeset 1206 in tests for trunk/tests/meta.php


Ignore:
Timestamp:
02/11/2013 06:21:59 PM (11 years ago)
Author:
ryan
Message:

Update cache tests to reflect new last_changed value. See #WP23448

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/meta.php

    r974 r1206  
    125125        $key = rand_str();
    126126        $value = 'Test\\singleslash';
    127         $expected = 'Testsingleslash';
     127        $expected = 'Test\\singleslash';
    128128        $value2 = 'Test\\\\doubleslash';
    129         $expected2 = 'Test\\doubleslash';
     129        $expected2 = 'Test\\\\doubleslash';
     130        $value3 = 'Test\oneslash';
     131        $expected3 = 'Test\oneslash';
    130132        $this->assertFalse( metadata_exists( 'user', $this->author->ID, $key ) );
    131133        $this->assertFalse( delete_metadata( 'user', $this->author->ID, $key ) );
     
    150152        $this->assertInternalType( 'int', update_metadata( 'user', $this->author->ID, $key, $value2 ) );
    151153        $this->assertEquals( $expected2, get_metadata( 'user', $this->author->ID, $key, true ) );
     154        $this->assertTrue( delete_metadata( 'user', $this->author->ID, $key ) );
     155        $this->assertSame( '', get_metadata( 'user', $this->author->ID, $key, true ) );
     156        $this->assertFalse( metadata_exists( 'user', $this->author->ID, $key ) );
     157
     158        $this->assertInternalType( 'int', add_metadata( 'user', $this->author->ID, $key, $value3 ) );
     159        $this->assertEquals( $expected3, get_metadata( 'user', $this->author->ID, $key, true ) );
     160        $this->assertTrue( delete_metadata( 'user', $this->author->ID, $key ) );
     161        $this->assertSame( '', get_metadata( 'user', $this->author->ID, $key, true ) );
     162        $this->assertInternalType( 'int', update_metadata( 'user', $this->author->ID, $key, $value3 ) );
     163        $this->assertEquals( $expected3, get_metadata( 'user', $this->author->ID, $key, true ) );
    152164    }
    153165}
Note: See TracChangeset for help on using the changeset viewer.