Takes setExpectedException()
2nd and next arguments to own methods in PHPUnit.
use PHPUnit\Framework\TestCase;
class SomeTest extends TestCase
{
public function test()
{
- $this->setExpectedException(SomeException::class, "Message", "CODE");
+ $this->setExpectedException(SomeException::class);
+ $this->expectExceptionMessage('Message');
+ $this->expectExceptionCode('CODE');
}
}
Configure your rector.php
:
<?php
use Rector\Config\RectorConfig;
use Rector\PHPUnit\PHPUnit60\Rector\MethodCall\DelegateExceptionArgumentsRector;
return RectorConfig::configure()
->withRules([
DelegateExceptionArgumentsRector::class,
]);