WordPress.org

Make WordPress Core

Changeset 37151


Ignore:
Timestamp:
03/30/2016 07:53:40 PM (3 years ago)
Author:
jorbin
Message:

Adjust unit tests to account for change in [37145].

Merges [37150] to 4.4 branch

Location:
branches/4.4
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/4.4

  • branches/4.4/tests/phpunit/tests/ajax/Compression.php

    r35211 r37151  
    144144        }
    145145
    146         // Check the site option
     146        // Check the site option is not changed due to lack of nonce
     147        $this->assertEquals( 0, get_site_option( 'can_compress_scripts' ) );
     148
     149        // Add a nonce
     150        $_GET['_ajax_nonce'] = wp_create_nonce( 'update_can_compress_scripts' );
     151
     152        // Retry the request
     153        try {
     154            $this->_handleAjax( 'wp-compression-test' );
     155        } catch ( WPAjaxDieStopException $e ) {
     156            unset( $e );
     157        }
     158
     159        // Check the site option is changed
    147160        $this->assertEquals( 1, get_site_option( 'can_compress_scripts' ) );
    148161    }
     
    169182        }
    170183
    171         // Check the site option
     184        // Check the site option is not changed due to lack of nonce
     185        $this->assertEquals( 1, get_site_option( 'can_compress_scripts' ) );
     186
     187        // Add a nonce
     188        $_GET['_ajax_nonce'] = wp_create_nonce( 'update_can_compress_scripts' );
     189
     190        // Retry the request
     191        try {
     192            $this->_handleAjax( 'wp-compression-test' );
     193        } catch ( WPAjaxDieStopException $e ) {
     194            unset( $e );
     195        }
     196
     197        // Check the site option is changed
    172198        $this->assertEquals( 0, get_site_option( 'can_compress_scripts' ) );
    173199    }
Note: See TracChangeset for help on using the changeset viewer.