HEX
Server: Apache
System: Linux pdx1-shared-a1-38 6.6.104-grsec-jammy+ #3 SMP Tue Sep 16 00:28:11 UTC 2025 x86_64
User: mmickelson (3396398)
PHP: 8.1.31
Disabled: NONE
Upload Files
File: //usr/local/wp/vendor/yoast/phpunit-polyfills/src/Polyfills/ExpectExceptionMessageMatches.php
<?php

namespace Yoast\PHPUnitPolyfills\Polyfills;

/**
 * Polyfill the TestCase::expectExceptionMessageMatches() method, which replaces
 * the TestCase::expectExceptionMessageRegExp() method.
 *
 * Introduced in PHPUnit 8.4.0.
 * The `TestCase::expectExceptionMessageRegExp()` method was soft deprecated in PHPUnit 8.4.0,
 * hard deprecated in PHPUnit 8.5.3 and removed in PHPUnit 9.0.0.
 *
 * @link https://github.com/sebastianbergmann/phpunit/commit/d1199cb2e43a934b51521656be9748f63febe18e
 * @link https://github.com/sebastianbergmann/phpunit/issues/4133
 * @link https://github.com/sebastianbergmann/phpunit/issues/3957
 *
 * @since 0.1.0
 */
trait ExpectExceptionMessageMatches {

	/**
	 * Set an expectation that an Exception message matches a pattern as per the regular expression.
	 *
	 * @param string $regularExpression The regular expression.
	 *
	 * @return void
	 */
	final public function expectExceptionMessageMatches( $regularExpression ) {
		$this->expectExceptionMessageRegExp( $regularExpression );
	}
}