= 80000 && version_compare( tests_get_phpunit_version(), '9.3', '<' ) ) { $this->markTestSkipped( 'To run on PHP 8, this test requires PHPUnit 9.3 or later.' ); } return parent::getMockForAbstractClass( $original_class_name, $arguments, $mock_class_name, $call_original_constructor, $call_original_clone, $call_autoload, $mocked_methods, $clone_arguments ); } /** * Returns a builder object to create mock objects using a fluent interface. * * This method replaces the native PHPUnit method to avoid parse errors * due to `match` being a reserved keyword in PHP 8. * * To run on PHP 8, the tests using this method require PHPUnit 9.3 or later. * * When the test suite is updated for compatibility with PHPUnit 9.x, * this override can be removed. * * @since 5.6.0 * * @param string|string[] $class_name */ public function getMockBuilder( $class_name ): PHPUnit\Framework\MockObject\MockBuilder { if ( PHP_VERSION_ID >= 80000 && version_compare( tests_get_phpunit_version(), '9.3', '<' ) ) { $this->markTestSkipped( 'To run on PHP 8, this test requires PHPUnit 9.3 or later.' ); } return parent::getMockBuilder( $class_name ); } }