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->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->assertSession()->responseContains() for non-HTML responses, like XML or Json. - $this->assertSession()->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->assertEquals() instead.</li>
<li>1421 uses (in 31 projects) Call to deprecated method assertIdentical() of class Drupal​\​Tests​\​BrowserTestBase. Deprecated in drupal:8.0.0 and is removed from drupal:10.0.0. Use $this->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->assertSession()->statusCodeEquals() instead.</li>
<li>1025 uses (in 84 projects) Call to deprecated method assertEqual() of class Drupal​\​KernelTests​\​KernelTestBase. Deprecated in drupal:8.0.0 and is removed from drupal:10.0.0. Use $this->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->assertSession()->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->assertSession()->fieldExists() or $this->assertSession()->buttonExists() or $this->assertSession()->fieldValueEquals() instead.</li>
<li>574 uses (in 72 projects) Call to deprecated method assertNoText() of class Drupal​\​Tests​\​BrowserTestBase. Deprecated in drupal:8.2.0 and is removed from drupal:10.0.0. Use - $this->assertSession()->responseNotContains() for non-HTML responses, like XML or Json. - $this->assertSession()->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​\​Tests​\​BrowserTestBase. Deprecated in drupal:8.2.0 and is removed from drupal:10.0.0. Use $this->assertSession()->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