Changeset 63948
- Timestamp:
- 09/26/2026 11:12:47 PM (3 days ago)
- Location:
- trunk/tests/phpunit/tests
- Files:
-
- 5 edited
-
ai-client/wpAiClientHttpClient.php (modified) (1 diff)
-
https-detection.php (modified) (2 diffs)
-
rest-api/rest-revisions-controller.php (modified) (2 diffs)
-
rewrite/numericSlugs.php (modified) (1 diff)
-
theme/wpThemeJsonResolver.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/ai-client/wpAiClientHttpClient.php
r62753 r63948 23 23 24 24 /** 25 * Captured URL from the last intercepted HTTP request.26 *27 * @var string28 */29 private $captured_url;30 31 /**32 * Captured args from the last intercepted HTTP request.33 *34 * @var array35 */36 private $captured_args;37 38 /**39 25 * Sets up a fresh client instance before each test. 40 26 */ -
trunk/tests/phpunit/tests/https-detection.php
r59517 r63948 5 5 */ 6 6 class Tests_HTTPS_Detection extends WP_UnitTestCase { 7 8 private $last_request_url;9 7 10 8 public function set_up() { … … 137 135 } 138 136 139 public function record_request_url( $response, $parsed_args, $url ) {140 $this->last_request_url = $url;141 return $response;142 }143 144 public function mock_success_with_sslverify( $response, $parsed_args ) {145 if ( ! empty( $parsed_args['sslverify'] ) ) {146 return $this->mock_success();147 }148 return $response;149 }150 151 public function mock_error_with_sslverify( $response, $parsed_args ) {152 if ( ! empty( $parsed_args['sslverify'] ) ) {153 return $this->mock_error();154 }155 return $response;156 }157 158 public function mock_success_without_sslverify( $response, $parsed_args ) {159 if ( empty( $parsed_args['sslverify'] ) ) {160 return $this->mock_success();161 }162 return $response;163 }164 165 public function mock_error_without_sslverify( $response, $parsed_args ) {166 if ( empty( $parsed_args['sslverify'] ) ) {167 return $this->mock_error();168 }169 return $response;170 }171 172 public function mock_not_found() {173 return array(174 'body' => '<!DOCTYPE html><html><head><title>404</title></head><body>Not Found</body></html>',175 'response' => array(176 'code' => 404,177 'message' => 'Not Found',178 ),179 );180 }181 182 public function mock_bad_source() {183 // Looks like a success response, but is not generated by WordPress (e.g. missing RSD link).184 return array(185 'body' => $this->get_sample_html_string(),186 'response' => array(187 'code' => 200,188 'message' => 'OK',189 ),190 );191 }192 193 private function mock_success() {194 // Success response containing RSD link.195 return array(196 'body' => $this->get_sample_html_string( get_echo( 'rsd_link' ) ),197 'response' => array(198 'code' => 200,199 'message' => 'OK',200 ),201 );202 }203 204 private function mock_error() {205 return new WP_Error( 'bad_ssl_certificate', 'Bad SSL certificate.' );206 }207 208 137 private function get_sample_html_string( $head_tag = '' ) { 209 138 return '<!DOCTYPE html><html><head><title>Page Title</title>' . $head_tag . '</head><body>Page Content.</body></html>'; -
trunk/tests/phpunit/tests/rest-api/rest-revisions-controller.php
r63896 r63948 18 18 private int $total_revisions; 19 19 20 private $revisions;21 22 20 private WP_Post $revision_1; 23 21 private int $revision_id1; … … 94 92 $revisions = wp_get_post_revisions( self::$post_id ); 95 93 $this->total_revisions = count( $revisions ); 96 $this->revisions = $revisions;97 94 $this->revision_1 = array_pop( $revisions ); 98 95 $this->revision_id1 = $this->revision_1->ID; -
trunk/tests/phpunit/tests/rewrite/numericSlugs.php
r53948 r63948 6 6 */ 7 7 class Tests_Rewrite_NumericSlugs extends WP_UnitTestCase { 8 private $old_current_user;9 8 private $author_id; 10 9 -
trunk/tests/phpunit/tests/theme/wpThemeJsonResolver.php
r63610 r63948 62 62 private $orig_theme_dir; 63 63 64 /**65 * @var array|null66 */67 private $queries;68 69 64 public static function set_up_before_class() { 70 65 parent::set_up_before_class(); … … 109 104 add_filter( 'template_root', array( $this, 'filter_set_theme_root' ) ); 110 105 add_filter( 'theme_file_uri', array( $this, 'filter_theme_file_uri' ) ); 111 $this->queries = array();112 106 // Clear caches. 113 107 wp_clean_themes_cache();
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)