Making WordPress.org


Ignore:
Timestamp:
12/23/2020 04:56:08 PM (4 years ago)
Author:
iandunn
Message:

Events: Port some tests to PHPUnit.

Switching to PHPUnit provides consistency with the rest of the ecosystem, removes a lot of custom code we'd otherwise have to maintain, and provides new features for free. The custom tests were originally created from scratch because of the lack of tooling available on sandboxes, but that problem can be solve with Composer.

This establishes the foundation for porting the rest of the tests in the future.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/api.wordpress.org/public_html/events/1.0/index.php

    r10543 r10544  
    11<?php
     2
    23namespace Dotorg\API\Events;
    34use stdClass;
     
    4647
    4748    // The test suite just needs the functions defined and doesn't want any headers or output
    48     if ( defined( 'RUNNING_TESTS' ) && RUNNING_TESTS ) {
     49    if (
     50        ( defined( 'RUNNING_TESTS' ) && RUNNING_TESTS ) ||
     51        ( defined( 'WPORG_RUNNING_TESTS' ) && WPORG_RUNNING_TESTS )
     52    ) {
    4953        disable_caching();
    5054        return;
     
    111115    require_once $base_dir . '/includes/wp-json-encode.php';
    112116
    113     if ( ! defined( 'RUNNING_TESTS' ) || ! RUNNING_TESTS ) {
     117    if (
     118        ( ! defined( 'RUNNING_TESTS' ) || ! RUNNING_TESTS ) ||
     119        ( ! defined( 'WPORG_RUNNING_TESTS' ) || ! WPORG_RUNNING_TESTS )
     120    ) {
    114121        require_once $base_dir . '/includes/object-cache.php';
    115122    }
Note: See TracChangeset for help on using the changeset viewer.