Top Drupal 10 deprecations to cover
>>> [!note] Migrated issue <!-- Drupal.org comment --> <!-- Migrated from issue #3219163. --> Reported by: [agentrickard](https://www.drupal.org/user/20975) >>> <p>Preliminary top 13 results as of 2021 March 31 for current 5420 Drupal 9 compatible projects:</p> <ol> <li><del>6981 uses (in 444 projects) Call to deprecated method drupalPostForm() of class Drupal\Tests\BrowserTestBase. Deprecated in drupal:9.1.0 and is removed from drupal:10.0.0. Use $this-&gt;submitForm() instead.</del></li> <li>3925 uses (in 189 projects) Call to deprecated method assertText() of class Drupal\Tests\BrowserTestBase. Deprecated in drupal:8.2.0 and is removed from drupal:10.0.0. Use - $this-&gt;assertSession()-&gt;responseContains() for non-HTML responses, like XML or Json. - $this-&gt;assertSession()-&gt;pageTextContains() for HTML responses. Unlike the deprecated assertText(), the passed text should be HTML decoded, exactly as a human sees it in the browser.</li> <li>2142 uses (in 150 projects) Call to deprecated method assertEqual() of class Drupal\Tests\BrowserTestBase. Deprecated in drupal:8.0.0 and is removed from drupal:10.0.0. Use $this-&gt;assertEquals() instead.</li> <li>1421 uses (in 31 projects) Call to deprecated method assertIdentical() of class Drupal&#8203;\&#8203;Tests&#8203;\&#8203;BrowserTestBase. Deprecated in drupal:8.0.0 and is removed from drupal:10.0.0. Use $this-&gt;assertSame() instead.</li> <li>1183 uses (in 185 projects) Call to deprecated method assertResponse() of class Drupal\Tests\BrowserTestBase. Deprecated in drupal:8.2.0 and is removed from drupal:10.0.0. Use $this-&gt;assertSession()-&gt;statusCodeEquals() instead.</li> <li>1025 uses (in 84 projects) Call to deprecated method assertEqual() of class Drupal&#8203;\&#8203;KernelTests&#8203;\&#8203;KernelTestBase. Deprecated in drupal:8.0.0 and is removed from drupal:10.0.0. Use $this-&gt;assertEquals() instead.</li> <li>849 uses (in 107 projects) Call to deprecated method assertRaw() of class Drupal\Tests\BrowserTestBase. Deprecated in drupal:8.2.0 and is removed from drupal:10.0.0. Use $this-&gt;assertSession()-&gt;responseContains() instead.</li> <li>737 uses (in 77 projects) Call to deprecated method assertFieldByName() of class Drupal\Tests\BrowserTestBase. Deprecated in drupal:8.2.0 and is removed from drupal:10.0.0. Use $this-&gt;assertSession()-&gt;fieldExists() or $this-&gt;assertSession()-&gt;buttonExists() or $this-&gt;assertSession()-&gt;fieldValueEquals() instead.</li> <li>574 uses (in 72 projects) Call to deprecated method assertNoText() of class Drupal&#8203;\&#8203;Tests&#8203;\&#8203;BrowserTestBase. Deprecated in drupal:8.2.0 and is removed from drupal:10.0.0. Use - $this-&gt;assertSession()-&gt;responseNotContains() for non-HTML responses, like XML or Json. - $this-&gt;assertSession()-&gt;pageTextNotContains() for HTML responses. Unlike the deprecated assertNoText(), the passed text should be HTML decoded, exactly as a human sees it in the browser.</li> <li>413 uses (in 199 projects) Class [redacted] extends deprecated class Symfony\Component\EventDispatcher\Event: since Symfony 4.3, use "Symfony\Contracts\EventDispatcher\Event" instead</li> <li>364 uses (in 81 projects) Call to deprecated method setMethods() of class PHPUnit\Framework\MockObject\MockBuilder: sebastianbergmann/phpunit#3687</li> <li>336 uses (in 37 projects) Call to deprecated method assertFieldChecked() of class Drupal&#8203;\&#8203;Tests&#8203;\&#8203;BrowserTestBase. Deprecated in drupal:8.2.0 and is removed from drupal:10.0.0. Use $this-&gt;assertSession()-&gt;checkboxChecked() instead.</li> <li>244 uses (in 49 projects) Call to deprecated function drush_log().</li> </ol> <p>I think 10 and 11 would be covered by other existing rectors. Not surprisingly almost all of these are about test methods that were mostly deprecated a long time ago and are already actionable to fix on Drupal 9 compatible projects within Drupal 9.</p> <p>---</p> <p>I will be breaking these into separate issues as time allows.</p> > Related issue: [Issue #3219156](https://www.drupal.org/node/3219156)
issue