[PhpUnit] Add polyfill for assertMatchesRegularExpression()
This commit is contained in:
parent
6d850e04be
commit
33eccd2a00
@ -11,8 +11,10 @@
|
|||||||
|
|
||||||
namespace Symfony\Bridge\PhpUnit\Legacy;
|
namespace Symfony\Bridge\PhpUnit\Legacy;
|
||||||
|
|
||||||
|
use PHPUnit\Framework\ExpectationFailedException;
|
||||||
use PHPUnit\Framework\MockObject\MockObject;
|
use PHPUnit\Framework\MockObject\MockObject;
|
||||||
use PHPUnit\Framework\TestCase;
|
use PHPUnit\Framework\TestCase;
|
||||||
|
use SebastianBergmann\RecursionContext\InvalidArgumentException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This trait is @internal.
|
* This trait is @internal.
|
||||||
@ -116,4 +118,18 @@ trait PolyfillTestCaseTrait
|
|||||||
$property->setAccessible(true);
|
$property->setAccessible(true);
|
||||||
$property->setValue($this, $messageRegExp);
|
$property->setValue($this, $messageRegExp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Asserts that a string matches a given regular expression.
|
||||||
|
*
|
||||||
|
* @param string $pattern
|
||||||
|
* @param string $string
|
||||||
|
* @param string $message
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function assertMatchesRegularExpression($pattern, $string, $message = '')
|
||||||
|
{
|
||||||
|
$this->assertRegExp($pattern, $string, $message);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user