Turns preg_match
comparisons to their method name alternatives in PHPUnit TestCase
-$this->assertSame(1, preg_match("/^Message for ".*"\.$/", $string), $message);
+$this->assertRegExp("/^Message for ".*"\.$/", $string, $message);
Configure your rector.php
:
<?php
use Rector\Config\RectorConfig;
use Rector\PHPUnit\CodeQuality\Rector\MethodCall\AssertRegExpRector;
return RectorConfig::configure()
->withRules([
AssertRegExpRector::class,
]);