eval-file tests/live/run.php [ ...] * * Exit code 0 when every test passed (XFAIL allowed), 1 otherwise. * Never run against a production site: suites create and delete fixtures. * * No strict_types here: wp eval-file evals this file, and a declare must be * the first statement of a real file. The required files declare it. * * @package WP_Data_Optimizer */ require __DIR__ . '/lib/assert.php'; require __DIR__ . '/lib/fixtures.php'; $tmdo_live_suites = isset( $args ) ? (array) $args : array(); if ( ! class_exists( 'TMDO_Hook_Bus' ) ) { fwrite( STDERR, "2meet-data-optimizer is not active on this site.\n" ); exit( 1 ); } if ( empty( $tmdo_live_suites ) ) { $tmdo_live_available = array_map( static function ( $f ) { return basename( $f, '.php' ); }, glob( __DIR__ . '/suites/*.php' ) ); fwrite( STDERR, 'Usage: wp eval-file tests/live/run.php ... Suites: ' . implode( ', ', $tmdo_live_available ) . "\n" ); exit( 1 ); } foreach ( $tmdo_live_suites as $tmdo_live_suite ) { $tmdo_live_file = __DIR__ . '/suites/' . basename( (string) $tmdo_live_suite ) . '.php'; if ( ! is_file( $tmdo_live_file ) ) { fwrite( STDERR, "Unknown suite: {$tmdo_live_suite}\n" ); exit( 1 ); } TMDO_Live::$suite = (string) $tmdo_live_suite; require $tmdo_live_file; } exit( TMDO_Live::run() ? 0 : 1 );