Preliminary top 13 results as of 2021 March 31 for current 5420 Drupal 9 compatible projects:

  1. 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.
  2. 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.
  3. 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.
  4. 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.
  5. 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.
  6. 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.
  7. 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.
  8. 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.
  9. 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.
  10. 413 uses (in 199 projects) Class [redacted] extends deprecated class Symfony\Component\EventDispatcher\Event: since Symfony 4.3, use "Symfony\Contracts\EventDispatcher\Event" instead
  11. 364 uses (in 81 projects) Call to deprecated method setMethods() of class PHPUnit\Framework\MockObject\MockBuilder: sebastianbergmann/phpunit#3687
  12. 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.
  13. 244 uses (in 49 projects) Call to deprecated function drush_log().

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.

---

I will be breaking these into separate issues as time allows.

Comments

agentrickard created an issue. See original summary.

mglaman’s picture

Title: Top Drupal 10 deprecations to cover » [PP-1] Top Drupal 10 deprecations to cover
Status: Active » Postponed
Related issues: +#3219156: Add support for Drupal 9

Marking this as postponed until #3219156: Add support for Drupal 9

mglaman’s picture

drupalPostForm will be fixed in #3219156: Add support for Drupal 9

mglaman’s picture

Category: Task » Plan

Here is the full list https://dev.acquia.com/drupal10/deprecation_status/errors

Making this issue a plan of attack

mglaman’s picture

Title: [PP-1] Top Drupal 10 deprecations to cover » Top Drupal 10 deprecations to cover
Issue summary: View changes
Status: Postponed » Active

We now have Drupal 9 support added in #3219156: Add support for Drupal 9 which adds a rule to fix drupalPostForm!

mglaman’s picture

mglaman’s picture

The following have rules in a PR for #3222671: AssertLegacyTrait rector rules

assertText
assertEqual
assertIdentical
assertResponse
assertRaw
assertFieldByName

Gábor Hojtsy’s picture

Woah, if the above top ones are resolved, 57% of the currently identified deprecated API uses will be covered by drupal-rector. That is quite an achievement. 20k of 35k instances found across all of contrib.