Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 0 additions & 14 deletions tests/phpunit/tests/ai-client/wpAiClientHttpClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,6 @@ class Tests_AI_Client_HTTP_Client extends WP_UnitTestCase {
*/
private $psr17_factory;

/**
* Captured URL from the last intercepted HTTP request.
*
* @var string
*/
private $captured_url;

/**
* Captured args from the last intercepted HTTP request.
*
* @var array
*/
private $captured_args;

/**
* Sets up a fresh client instance before each test.
*/
Expand Down
71 changes: 0 additions & 71 deletions tests/phpunit/tests/https-detection.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
*/
class Tests_HTTPS_Detection extends WP_UnitTestCase {

private $last_request_url;

public function set_up() {
parent::set_up();

Expand Down Expand Up @@ -136,75 +134,6 @@ public function test_wp_is_local_html_output_cannot_determine() {
$this->assertNull( wp_is_local_html_output( $html ) );
}

public function record_request_url( $response, $parsed_args, $url ) {
$this->last_request_url = $url;
return $response;
}

public function mock_success_with_sslverify( $response, $parsed_args ) {
if ( ! empty( $parsed_args['sslverify'] ) ) {
return $this->mock_success();
}
return $response;
}

public function mock_error_with_sslverify( $response, $parsed_args ) {
if ( ! empty( $parsed_args['sslverify'] ) ) {
return $this->mock_error();
}
return $response;
}

public function mock_success_without_sslverify( $response, $parsed_args ) {
if ( empty( $parsed_args['sslverify'] ) ) {
return $this->mock_success();
}
return $response;
}

public function mock_error_without_sslverify( $response, $parsed_args ) {
if ( empty( $parsed_args['sslverify'] ) ) {
return $this->mock_error();
}
return $response;
}

public function mock_not_found() {
return array(
'body' => '<!DOCTYPE html><html><head><title>404</title></head><body>Not Found</body></html>',
'response' => array(
'code' => 404,
'message' => 'Not Found',
),
);
}

public function mock_bad_source() {
// Looks like a success response, but is not generated by WordPress (e.g. missing RSD link).
return array(
'body' => $this->get_sample_html_string(),
'response' => array(
'code' => 200,
'message' => 'OK',
),
);
}

private function mock_success() {
// Success response containing RSD link.
return array(
'body' => $this->get_sample_html_string( get_echo( 'rsd_link' ) ),
'response' => array(
'code' => 200,
'message' => 'OK',
),
);
}

private function mock_error() {
return new WP_Error( 'bad_ssl_certificate', 'Bad SSL certificate.' );
}

private function get_sample_html_string( $head_tag = '' ) {
return '<!DOCTYPE html><html><head><title>Page Title</title>' . $head_tag . '</head><body>Page Content.</body></html>';
}
Expand Down
3 changes: 0 additions & 3 deletions tests/phpunit/tests/rest-api/rest-revisions-controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ class WP_Test_REST_Revisions_Controller extends WP_Test_REST_Controller_Testcase

private int $total_revisions;

private $revisions;

private WP_Post $revision_1;
private int $revision_id1;
private WP_Post $revision_2;
Expand Down Expand Up @@ -93,7 +91,6 @@ public function set_up() {
// Set first post revision vars.
$revisions = wp_get_post_revisions( self::$post_id );
$this->total_revisions = count( $revisions );
$this->revisions = $revisions;
$this->revision_1 = array_pop( $revisions );
$this->revision_id1 = $this->revision_1->ID;
$this->revision_2 = array_pop( $revisions );
Expand Down
1 change: 0 additions & 1 deletion tests/phpunit/tests/rewrite/numericSlugs.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
* @ticket 5305
*/
class Tests_Rewrite_NumericSlugs extends WP_UnitTestCase {
private $old_current_user;
private $author_id;

public function set_up() {
Expand Down
6 changes: 0 additions & 6 deletions tests/phpunit/tests/theme/wpThemeJsonResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,6 @@ class Tests_Theme_wpThemeJsonResolver extends WP_UnitTestCase {
*/
private $orig_theme_dir;

/**
* @var array|null
*/
private $queries;

public static function set_up_before_class() {
parent::set_up_before_class();

Expand Down Expand Up @@ -108,7 +103,6 @@ public function set_up() {
add_filter( 'stylesheet_root', array( $this, 'filter_set_theme_root' ) );
add_filter( 'template_root', array( $this, 'filter_set_theme_root' ) );
add_filter( 'theme_file_uri', array( $this, 'filter_theme_file_uri' ) );
$this->queries = array();
// Clear caches.
wp_clean_themes_cache();
unset( $GLOBALS['wp_themes'] );
Expand Down
Loading