WordPress.org

Make WordPress Core

Changeset 652 in tests


Ignore:
Timestamp:
04/08/12 21:08:42 (3 years ago)
Author:
kurtpayne
Message:

Switching $expected and $actual with assertEquals(). Fixing a bad test about behavior that appeared when the global $post and $content objects were reset in tearDown().

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wp-testcase/test-ajax-actions/test_admin_ajax_get_comments.php

    r550 r652  
    8787 
    8888        // Check the meta data 
    89         $this->assertEquals( (string) $xml->response[0]->comments['position'], 1 ); 
    90         $this->assertEquals( (string) $xml->response[0]->comments['id'], 0 ); 
    91         $this->assertEquals( (string) $xml->response['action'], 'get-comments_0' ); 
     89        $this->assertEquals( 1, (string) $xml->response[0]->comments['position'] ); 
     90        $this->assertEquals( 0, (string) $xml->response[0]->comments['id'] ); 
     91        $this->assertEquals( 'get-comments_0', (string) $xml->response['action'] ); 
    9292         
    9393        // Check the payload 
     
    154154 
    155155        // Make the request 
     156        $this->setExpectedException( 'WPAjaxDieException', '-1' ); 
    156157        $this->_handleAjax( 'get-comments' ); 
    157          
    158         // Get the response 
    159         $xml = simplexml_load_string( $this->_last_response, 'SimpleXMLElement', LIBXML_NOCDATA ); 
    160  
    161         // Check the meta data 
    162         $this->assertEquals( (string) $xml->response[0]->comments['position'], 1 ); 
    163         $this->assertEquals( (string) $xml->response[0]->comments['id'], 0 ); 
    164         $this->assertEquals( (string) $xml->response['action'], 'get-comments_0' ); 
    165          
    166         // Check the payload 
    167         $this->assertNotEmpty( (string) $xml->response[0]->comments[0]->response_data ); 
    168          
    169         // And supplemental is empty 
    170         $this->assertEmpty( (string) $xml->response[0]->comments[0]->supplemental ); 
    171158    } 
    172159 
Note: See TracChangeset for help on using the changeset viewer.