WordPress.org

Make WordPress Core

Ticket #53363: 53363-08-testcases-should-be-abstract.patch

File 53363-08-testcases-should-be-abstract.patch, 1.5 KB (added by jrf, 4 months ago)

Build/Tests: testcases should be abstract TestCases which are intended to be extended and not run directly, should be abstract.

  • tests/phpunit/includes/testcase-canonical.php

    From a0083473c13a59f4836b2540239848589c12e06b Mon Sep 17 00:00:00 2001
    From: jrfnl <jrfnl@users.noreply.github.com>
    Date: Tue, 20 Jul 2021 15:56:59 +0200
    Subject: [PATCH] Build/Tests: testcases should be abstract
    
    TestCases which are intended to be extended and not run directly, should be `abstract`.
    ---
     tests/phpunit/includes/testcase-canonical.php | 2 +-
     tests/phpunit/includes/testcase-xmlrpc.php    | 2 +-
     2 files changed, 2 insertions(+), 2 deletions(-)
    
    diff --git a/tests/phpunit/includes/testcase-canonical.php b/tests/phpunit/includes/testcase-canonical.php
    index ef33ca8db8..833df23e5b 100644
    a b  
    11<?php
    22
    3 class WP_Canonical_UnitTestCase extends WP_UnitTestCase {
     3abstract class WP_Canonical_UnitTestCase extends WP_UnitTestCase {
    44        public static $old_current_user;
    55        public static $author_id;
    66        public static $post_ids    = array();
  • tests/phpunit/includes/testcase-xmlrpc.php

    diff --git a/tests/phpunit/includes/testcase-xmlrpc.php b/tests/phpunit/includes/testcase-xmlrpc.php
    index 7ae8d10e62..8e8026b5c9 100644
    a b require_once ABSPATH . 'wp-admin/includes/admin.php'; 
    33require_once ABSPATH . WPINC . '/class-IXR.php';
    44require_once ABSPATH . WPINC . '/class-wp-xmlrpc-server.php';
    55
    6 class WP_XMLRPC_UnitTestCase extends WP_UnitTestCase {
     6abstract class WP_XMLRPC_UnitTestCase extends WP_UnitTestCase {
    77        protected $myxmlrpcserver;
    88
    99        function set_up() {