title: catching ArgumentCountError and PHPUnit_Framework_Error_Warning
body: <p>Someone submitted a pull request to a library of mine wherein a parameter was made optional by replacing something like <code>function doSomething($var)</code> with <code>function doSomething($var = 'whatever')</code>.</p>
  
  <p>So I added a unit test to make sure that an error would be issued if you didn't pass enough variables to the method. To catch this I was using the PHPUnit annotation <code>@expectedException</code>. For PHP 7.0 the expected exception is <code>PHPUnit_Framework_Error_Warning</code> but for PHP 7.1+ the expected exception is <code>ArgumentCountError</code>. This presents a small problem. I can make the tests pass PHP 7.0 and earlier or pass PHP 7.1 and later. I can't make them support both.</p>
  
  <p>Another PHPUnit annotation is <code>@requires</code> but it seems like that only lets you restrict tests to a minimum PHP version - not to a maximum PHP version. eg. if I do <code>@requires PHP 7.1</code> that'd mean that PHP 7.1 is the minimum version of PHP required to run the test but that there's no way to make PHP 7.0 the maximum version to run a test.</p>
  
  <p>I thought doing <code>@expectedException Exception</code> would work (since presumably <code>PHPUnit_Framework_Error_Warning</code> and <code>ArgumentCountError</code> both extend Exception but that does not appear to be the case either.</p>
  
  <p>It'd be cool if I could do something like <code>@expectedException PHPUnit_Framework_Error_Warning|ArgumentCountError</code> but nothing in the PHPUnit docs leads me to believe that I can and <a href="https://github.com/sebastianbergmann/phpunit/issues/2216" rel="nofollow noreferrer">https://github.com/sebastianbergmann/phpunit/issues/2216</a> makes it sound like that can't be done period.</p>
  
  <p>Maybe I should just remove this particular unit test all together?</p>