ExceptionAnnotationRector

Changes @expectedException annotations to expectException*()` methods

-/**
- * @expectedException Exception
- * @expectedExceptionMessage Message
- */
 public function test()
 {
+    $this->expectException('Exception');
+    $this->expectExceptionMessage('Message');
     // tested code
 }

Configure your rector.php:

<?php

use Rector\Config\RectorConfig;
use Rector\PHPUnit\PHPUnit60\Rector\ClassMethod\ExceptionAnnotationRector;

return RectorConfig::configure()
    ->withRules([
        ExceptionAnnotationRector::class,
    ]);