AssertNoFieldByNameRector
Fixes deprecated AssertLegacyTrait::assertNoFieldByName() calls
-$this->assertNoFieldByName('name');
- $this->assertNoFieldByName('name', 'not the value');
- $this->assertNoFieldByName('notexisting');
- $this->assertNoFieldByName('notexisting', NULL);
+$this->assertSession()->fieldValueNotEquals('name', '');
+ $this->assertSession()->fieldValueNotEquals('name', 'not the value');
+ $this->assertSession()->fieldValueNotEquals('notexisting', '');
+ $this->assertSession()->fieldNotExists('notexisting');
Configure your rector.php:
<?php
use DrupalRector\Drupal9\Rector\Deprecation\AssertNoFieldByNameRector;
use Rector\Config\RectorConfig;
return RectorConfig::configure()
->withRules([
AssertNoFieldByNameRector::class,
]);