BehatPHPUnitAssertToWebmozartRector

Change PHPUnit assert in Behat context files to Webmozart Assert, as first require a TestCase instance

 use Behat\Behat\Context\Context;
-use PHPUnit\Framework\Assert;
+use Webmozart\Assert\Assert;

 final class SomeContext implements Context
 {
     public function someMethod()
     {
-        Assert::assertSame('expected', 'actual');
+        Assert::same('actual', 'expected');
     }
 }

Configure your rector.php:

<?php

use Rector\Config\RectorConfig;
use Rector\PHPUnit\CodeQuality\Rector\ClassMethod\BehatPHPUnitAssertToWebmozartRector;

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