Find a Rector rule

Find the best Rector rule to solve your problem. Searching through 1108 rules.

Found 1 rule. That's the one: Clear

phpunit/phpunit 8 1 match
ExplicitPhpErrorApiRector phpunit/phpunit >=8.4 <10.0

Use explicit API for expecting PHP errors, warnings, and notices

 final class SomeTest extends \PHPUnit\Framework\TestCase
 {
     public function test()
     {
-        $this->expectException(\PHPUnit\Framework\TestCase\Deprecated::class);
-        $this->expectException(\PHPUnit\Framework\TestCase\Error::class);
-        $this->expectException(\PHPUnit\Framework\TestCase\Notice::class);
-        $this->expectException(\PHPUnit\Framework\TestCase\Warning::class);
+        $this->expectDeprecation();
+        $this->expectError();
+        $this->expectNotice();
+        $this->expectWarning();
     }
 }