Make WordPress Core

Changeset 967 in tests for trunk/tests/ajax/Autosave.php


Ignore:
Timestamp:
08/13/2012 09:07:27 PM (13 years ago)
Author:
ryan
Message:

Pinking shears

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/ajax/Autosave.php

    r904 r967  
    2222     */
    2323    protected $_post = null;
    24    
     24
    2525    /**
    2626     * Set up the test fixture
     
    3737     */
    3838    public function test_nopriv_autosave() {
    39        
     39
    4040        // Log out
    4141        wp_logout();
    42        
     42
    4343        // Set up a default request
    4444        $_POST = array(
     
    4646            'autosave' => 1
    4747        );
    48        
     48
    4949        // Make the request
    5050        try {
     
    6767     */
    6868    public function test_nopriv_no_postid() {
    69        
     69
    7070        // Log out
    7171        wp_logout();
    72        
     72
    7373        // Set up a request
    7474        $_POST = array(
    7575            'autosave'      => 1
    7676        );
    77        
     77
    7878        // Make the request
    7979        $this->setExpectedException( 'WPAjaxDieStopException', '-1' );
    8080        $this->_handleAjax( 'nopriv_autosave' );
    8181    }
    82    
     82
    8383    /**
    8484     * Test autosaving a post
     
    8989        // Become an admin
    9090        $this->_setRole( 'administrator' );
    91            
     91
    9292        // Set up the $_POST request
    9393        $md5 = md5( uniqid() );
     
    105105            unset( $e );
    106106        }
    107        
     107
    108108        // Get the response
    109109        $xml = simplexml_load_string( $this->_last_response, 'SimpleXMLElement', LIBXML_NOCDATA );
     
    112112        $this->assertEquals( $this->_post->ID, (int) $xml->response[0]->autosave['id'] );
    113113        $this->assertEquals( 'autosave_' . $this->_post->ID, (string) $xml->response['action']);
    114        
     114
    115115        // Check that the edit happened
    116116        $post = get_post( $this->_post->ID) ;
     
    123123     */
    124124    public function test_with_invalid_nonce( ) {
    125        
    126         // Become an administrator     
     125
     126        // Become an administrator
    127127        $this->_setRole( 'administrator' );
    128128
     
    138138        $this->_handleAjax( 'autosave' );
    139139    }
    140    
     140
    141141    /**
    142142     * Test with a bad post id
     
    144144     */
    145145    public function test_with_invalid_post_id( ) {
    146        
    147         // Become an administrator 
     146
     147        // Become an administrator
    148148        $this->_setRole( 'administrator' );
    149149
     
    159159        $this->_handleAjax( 'autosave' );
    160160    }
    161    
     161
    162162    /**
    163163     * Test with a locked post
     
    166166    public function test_locked_post() {
    167167
    168         // Become an administrator     
    169         $this->_setRole( 'administrator' );
    170        
     168        // Become an administrator
     169        $this->_setRole( 'administrator' );
     170
    171171        // Lock the post
    172172        wp_set_post_lock( $this->_post->ID );
    173        
     173
    174174        // Become a different administrator
    175175        $this->_setRole( 'administrator' );
    176    
     176
    177177        // Set up the $_POST request
    178178        $_POST = array(
     
    207207        $login_grace_period = 1;
    208208
    209         // Become an admnistrator       
    210         $this->_setRole( 'administrator' );
    211            
     209        // Become an admnistrator
     210        $this->_setRole( 'administrator' );
     211
    212212        // Set up the $_POST request
    213213        $_POST = array(
Note: See TracChangeset for help on using the changeset viewer.