fix: Change assertPattern()/assertNoPattern() to match changes in PHPUnit API

This commit is contained in:
Koji Tanaka 2022-12-30 17:14:09 +09:00 committed by Kamil Wylegala
parent 0a05486693
commit e99ea6021c

View file

@ -552,7 +552,7 @@ abstract class CakeTestCase extends \PHPUnit\Framework\TestCase {
}
/**
* Compatibility wrapper function for assertRegexp
* Compatibility wrapper function for assertMatchesRegularExpression
*
* @param mixed $pattern a regular expression
* @param string $string the text to be matched
@ -561,7 +561,7 @@ abstract class CakeTestCase extends \PHPUnit\Framework\TestCase {
* @return void
*/
protected static function assertPattern($pattern, $string, $message = '') {
return static::assertRegExp($pattern, $string, $message);
return static::assertMatchesRegularExpression($pattern, $string, $message);
}
/**
@ -591,7 +591,7 @@ abstract class CakeTestCase extends \PHPUnit\Framework\TestCase {
}
/**
* Compatibility wrapper function for assertNotRegExp
* Compatibility wrapper function for assertDoesNotMatchRegularExpression
*
* @param mixed $pattern a regular expression
* @param string $string the text to be matched
@ -600,7 +600,7 @@ abstract class CakeTestCase extends \PHPUnit\Framework\TestCase {
* @return void
*/
protected static function assertNoPattern($pattern, $string, $message = '') {
return static::assertNotRegExp($pattern, $string, $message);
return static::assertDoesNotMatchRegularExpression($pattern, $string, $message);
}
/**