非推奨とされている expectException() が使用されていることを報告します。

expectException() メソッドを \PHPUnit\Framework\Error\Deprecated\PHPUnit\Framework\Error\Error\PHPUnit\Framework\Error\Notice、および \PHPUnit\Framework\Error\Warning と併用することは非推奨とされており、PHPUnit 10 ではサポートされなくなります。

代わりに、expectDeprecation()expectError()expectNotice()、および expectWarning() メソッドを使用する必要があります。

詳しくは、Testing PHP Errors, Warnings, and Notices (phpunit.readthedocs.io) を参照してください。