Make WordPress Core

Changeset 861 in tests


Ignore:
Timestamp:
07/02/2012 11:00:45 AM (14 years ago)
Author:
duck_
Message:

Fix a number of notices in the import tests

Default $new to array(). Remove reference to undefined $message. WXR 1.0 files
require either mapping to an existing ID or a new user name.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-testcase/test_import_wp.php

    r815 r861  
    3131        assert('is_file($file)');
    3232
    33         $authors = $mapping = array();
     33        $authors = $mapping = $new = array();
    3434        $i = 0;
    3535
     
    233233
    234234        $post = $result['posts'][0];
    235         $this->assertEquals( 'Content with nested <![CDATA[ tags ]]> :)', $post['post_content'], $message );
     235        $this->assertEquals( 'Content with nested <![CDATA[ tags ]]> :)', $post['post_content'] );
    236236        foreach ( $post['postmeta'] as $meta ) {
    237237            switch ( $meta['key'] ) {
     
    241241                default: $this->fail( 'Unknown postmeta (' . $meta['key'] . ') was parsed out by' . $p );
    242242            }
    243             $this->assertEquals( $value, $meta['value'], $message );
     243            $this->assertEquals( $value, $meta['value'] );
    244244        }
    245245    }
     
    490490
    491491    function test_serialized_postmeta_no_cdata() {
    492         $this->_import_wp( DIR_TESTDATA . '/export/test-serialized-postmeta-no-cdata.xml', array( 'johncoswell' => false ) );
     492        $this->_import_wp( DIR_TESTDATA . '/export/test-serialized-postmeta-no-cdata.xml', array( 'johncoswell' => 'john' ) );
    493493        $expected['special_post_title'] = 'A special title';
    494494        $expected['is_calendar'] = '';
     
    497497
    498498    function test_utw_postmeta() {
    499         $this->_import_wp( DIR_TESTDATA . '/export/test-utw-post-meta-import.xml', array( 'johncoswell' => false ) );
     499        $this->_import_wp( DIR_TESTDATA . '/export/test-utw-post-meta-import.xml', array( 'johncoswell' => 'john' ) );
    500500
    501501        $classy = new StdClass();
     
    561561    // #9633
    562562    function test_serialized_postmeta_with_cdata() {
    563         $this->_import_wp( DIR_TESTDATA . '/export/test-serialized-postmeta-with-cdata.xml', array( 'johncoswell' => false ) );
     563        $this->_import_wp( DIR_TESTDATA . '/export/test-serialized-postmeta-with-cdata.xml', array( 'johncoswell' => 'johncoswell' ) );
    564564
    565565        //HTML in the CDATA should work with old WordPress version
     
    573573    // #11574
    574574    function test_serialized_postmeta_with_evil_stuff_in_cdata() {
    575         $this->_import_wp( DIR_TESTDATA . '/export/test-serialized-postmeta-with-cdata.xml', array( 'johncoswell' => false ) );
     575        $this->_import_wp( DIR_TESTDATA . '/export/test-serialized-postmeta-with-cdata.xml', array( 'johncoswell' => 'johncoswell' ) );
    576576        // evil content in the CDATA
    577577        $this->assertEquals( '<wp:meta_value>evil</wp:meta_value>', get_post_meta( 10, 'evil', true ) );
Note: See TracChangeset for help on using the changeset viewer.