0 ) { echo " {$total} checks, " . self::$failed . " FAILED\n\n"; return 1; } echo " {$total} checks, all passed\n\n"; return 0; } } // --- WordPress functions the tested classes call ----------------------------- if ( ! function_exists( 'wp_parse_url' ) ) { function wp_parse_url( $url, $component = -1 ) { return parse_url( $url, $component ); } } if ( ! function_exists( 'home_url' ) ) { function home_url( $path = '' ) { return 'https://example.test' . ( '' !== $path ? $path : '' ); } } if ( ! function_exists( 'site_url' ) ) { function site_url( $path = '' ) { return home_url( $path ); } } if ( ! function_exists( 'set_url_scheme' ) ) { function set_url_scheme( $url, $scheme = null ) { return preg_replace( '#^\w+://#', ( $scheme ? $scheme : 'https' ) . '://', (string) $url ); } } if ( ! function_exists( 'untrailingslashit' ) ) { function untrailingslashit( $value ) { return rtrim( (string) $value, '/\\' ); } } if ( ! function_exists( 'apply_filters' ) ) { function apply_filters( $hook, $value ) { return $value; } } if ( ! function_exists( 'size_format' ) ) { function size_format( $bytes ) { return $bytes . ' bytes'; } } if ( ! function_exists( 'esc_html' ) ) { function esc_html( $text ) { return htmlspecialchars( (string) $text, ENT_QUOTES, 'UTF-8' ); } } if ( ! function_exists( '__' ) ) { function __( $text, $domain = '' ) { return $text; } } // --- the code under test ----------------------------------------------------- $core = __DIR__ . '/../plugins/sirius-press-core/includes/'; require_once $core . 'class-sp-bn.php'; require_once $core . 'class-sp-secp256k1.php'; require_once $core . 'class-sp-cashaddr.php'; require_once $core . 'class-sp-hd.php'; require_once $core . 'class-sp-message.php'; /* * These three reference WordPress functions only from inside their methods, so * they load cleanly here and the suite exercises the code that actually ships * rather than a copy of it. */ require_once $core . 'class-sp-gateway.php'; $export = __DIR__ . '/../plugins/sirius-press-sia-export/includes/'; require_once $export . 'class-spe-mapper.php'; require_once $export . 'class-spe-renderer.php';