WordPress.org

Make WordPress Core

Changeset 651 in tests


Ignore:
Timestamp:
04/08/12 21:08:09 (2 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_edit_comment.php

    r551 r651  
    8282 
    8383        // Check the meta data 
    84         $this->assertEquals( (string) $xml->response[0]->edit_comment['position'], -1 ); 
    85         $this->assertEquals( (string) $xml->response[0]->edit_comment['id'], $comment->comment_ID ); 
    86         $this->assertEquals( (string) $xml->response['action'], 'edit-comment_' . $comment->comment_ID ); 
     84        $this->assertEquals( -1, (string) $xml->response[0]->edit_comment['position'] ); 
     85        $this->assertEquals( $comment->comment_ID, (string) $xml->response[0]->edit_comment['id'] ); 
     86        $this->assertEquals( 'edit-comment_' . $comment->comment_ID, (string) $xml->response['action'] ); 
    8787         
    8888        // Check the payload 
     
    161161 
    162162        // Make the request 
     163        $this->setExpectedException( 'WPAjaxDieException', '-1' ); 
    163164        $this->_handleAjax( 'edit-comment' ); 
    164  
    165         // Get the response 
    166         $xml = simplexml_load_string( $this->_last_response, 'SimpleXMLElement', LIBXML_NOCDATA ); 
    167  
    168         // Get the response 
    169         $xml = simplexml_load_string( $this->_last_response, 'SimpleXMLElement', LIBXML_NOCDATA ); 
    170  
    171         // Check the meta data 
    172         $this->assertEquals( (string) $xml->response[0]->edit_comment['position'], -1 ); 
    173         $this->assertEmpty( (string) $xml->response[0]->edit_comment['id'] ); 
    174         $this->assertEquals( (string) $xml->response['action'], 'edit-comment_' ); 
    175          
    176         // Check the payload 
    177         $this->assertNotEmpty( (string) $xml->response[0]->edit_comment[0]->response_data ); 
    178          
    179         // And supplemental is empty 
    180         $this->assertEmpty( (string) $xml->response[0]->edit_comment[0]->supplemental ); 
    181165    } 
    182166} 
Note: See TracChangeset for help on using the changeset viewer.