Turns accidentally flipped assert order to right one, with expected expr to left
<?php
namespace RectorPrefix202411;
use PHPUnit\Framework\TestCase;
class SomeTest extends TestCase
{
public function test()
{
$result = '...';
- $this->assertSame($result, 'expected');
+ $this->assertSame('expected', $result);
}
}
\class_alias('SomeTest', 'SomeTest', \false);
Configure your rector.php
:
<?php
use Rector\Config\RectorConfig;
use Rector\PHPUnit\CodeQuality\Rector\MethodCall\FlipAssertRector;
return RectorConfig::configure()
->withRules([
FlipAssertRector::class,
]);