Changeset 47122 for trunk/tests/phpunit/tests/ajax/Response.php
- Timestamp:
- 01/29/2020 12:43:23 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/ajax/Response.php
r46586 r47122 1 1 <?php 2 2 /** 3 * Testing ajax response class3 * Testing Ajax response class 4 4 * 5 5 * @package WordPress … … 27 27 add_filter( 'wp_doing_ajax', '__return_true' ); 28 28 29 // Suppress warnings from "Cannot modify header information - headers already sent by" 29 // Suppress warnings from "Cannot modify header information - headers already sent by". 30 30 $this->_error_level = error_reporting(); 31 31 error_reporting( $this->_error_level & ~E_WARNING ); … … 78 78 } 79 79 80 // Generate an ajax response80 // Generate an Ajax response. 81 81 ob_start(); 82 82 $ajax_response = new WP_Ajax_Response(); 83 83 $ajax_response->send(); 84 84 85 // Check the header 85 // Check the header. 86 86 $headers = xdebug_get_headers(); 87 87 ob_end_clean(); … … 97 97 public function test_response_charset_in_xml() { 98 98 99 // Generate an ajax response99 // Generate an Ajax response. 100 100 ob_start(); 101 101 $ajax_response = new WP_Ajax_Response(); 102 102 $ajax_response->send(); 103 103 104 // Check the XML tag 104 // Check the XML tag. 105 105 $contents = ob_get_clean(); 106 106 $this->assertRegExp( '/<\?xml\s+version=\'1.0\'\s+encoding=\'' . preg_quote( get_option( 'blog_charset' ) ) . '\'\s+standalone=\'yes\'\?>/', $contents );
Note: See TracChangeset
for help on using the changeset viewer.