Question: I running tests using PHPUnit 9 and when I do an `assertRegExp` I get a Warning

```
assertRegExp() is deprecated and will be removed in PHPUnit 10. Refactor your code to use assertMatchesRegularExpression() instead.

```

How do I suppress the deprecation warning for the particular test?

**Note**: - I an using Laravel Dusk to run my test and I using the test helper `assertPathIs`.

Answer: 
From reading [this blog post](https://thephp.cc/news/2019/02/help-my-tests-stopped-working#deprecations) from the author of PHPUnit, there is no built in option to suppress these warnings:

> 
> PHPUnit reports a test that uses deprecated functionality with a warning because I know how developers use, or rather not use, PHP's E\_DEPRECATED messages. **ou cannot opt out of getting this information from PHPUnit**.
> 
> 
> 

This should not mark tests as failed with the default configuration:

> 
> By default, PHPUnit's command-line test runner exits with shell exit code 0 when the use of a deprecated feature is reported. This shell exit code is used to indicate that no error occurred. This information is used by continuous integration environments, for instance, to decide whether or not the build was successful. If you want your build to fail because the tests use deprecated functionality from PHPUnit, configure failOnWarning="true" in phpunit.xml. This instructs PHPUnit to exit with shell exit code 1 when deprecated assertions are used.
> 
> 
>
If you want to temporarily hide the deprecation warnings against the developers best wishes, comment out line 219 of `vendor/bin/.phpunit/phpunit-9.5-0/vendor/symfony/phpunit-bridge/DeprecationErrorHandler.php`. In case the file changes, the line to be commented reads: `$this->displayDeprecations($groups, $configuration, $isFailingAtShutdown);`