Deprecated - 9.5.x - drupal

Primary tabs

Title File name Deprecation Type Direct uses Namespaced uses Overrides Use statements
Action core/modules/action/src/Plugin/migrate/source/Action.php

in drupal:9.4.0 and is removed from drupal:10.0.0. Use \Drupal\system\Plugin\migrate\source\Action instead.

class 1
AssertBlockAppearsTrait::findBlockInstance core/modules/block/tests/src/Functional/AssertBlockAppearsTrait.php

in drupal:9.5.0 and is removed from drupal:11.0.0. There is no replacement.

function
AssertHelperTrait core/tests/Drupal/Tests/AssertHelperTrait.php

in drupal:9.2.0 and is removed from drupal:10.0.0. There is no replacement.

trait
AssertHelperTrait::castSafeStrings core/tests/Drupal/Tests/AssertHelperTrait.php

in drupal:9.2.0 and is removed from drupal:10.0.0. There is no replacement, just use assertEquals in tests.

function 1
AssertLegacyTrait core/tests/Drupal/KernelTests/AssertLegacyTrait.php

in drupal:8.0.0 and is removed from drupal:10.0.0. Use PHPUnit's native assert methods instead.

trait 1
AssertLegacyTrait core/tests/Drupal/FunctionalTests/AssertLegacyTrait.php

in drupal:8.2.0 and is removed from drupal:10.0.0. Use the methods from \Drupal\Tests\WebAssert instead.

trait 2
AssertLegacyTrait::assert core/tests/Drupal/KernelTests/AssertLegacyTrait.php

in drupal:8.0.0 and is removed from drupal:10.0.0. Use $this->assertTrue() instead.

function 1
AssertLegacyTrait::assertCacheTag core/tests/Drupal/FunctionalTests/AssertLegacyTrait.php

in drupal:8.2.0 and is removed from drupal:10.0.0. Use $this->assertSession()->responseHeaderContains() instead.

function 1
AssertLegacyTrait::assertElementNotPresent core/tests/Drupal/FunctionalTests/AssertLegacyTrait.php

in drupal:8.2.0 and is removed from drupal:10.0.0. Use $this->assertSession()->elementNotExists() instead.

function 1
AssertLegacyTrait::assertElementPresent core/tests/Drupal/FunctionalTests/AssertLegacyTrait.php

in drupal:8.2.0 and is removed from drupal:10.0.0. Use $this->assertSession()->elementExists() instead.

function 1
AssertLegacyTrait::assertEqual core/tests/Drupal/KernelTests/AssertLegacyTrait.php

in drupal:8.0.0 and is removed from drupal:10.0.0. Use $this->assertEquals() instead.

function 1
AssertLegacyTrait::assertEscaped core/tests/Drupal/FunctionalTests/AssertLegacyTrait.php

in drupal:8.2.0 and is removed from drupal:10.0.0. Use $this->assertSession()->assertEscaped() instead.

function 1
AssertLegacyTrait::assertField core/tests/Drupal/FunctionalTests/AssertLegacyTrait.php

in drupal:8.2.0 and is removed from drupal:10.0.0. Use $this->assertSession()->fieldExists() or $this->assertSession()->buttonExists() instead.

function 1
AssertLegacyTrait::assertFieldById core/tests/Drupal/FunctionalTests/AssertLegacyTrait.php

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.

function 1
AssertLegacyTrait::assertFieldByName core/tests/Drupal/FunctionalTests/AssertLegacyTrait.php

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.

function 1
AssertLegacyTrait::assertFieldByXPath core/tests/Drupal/FunctionalTests/AssertLegacyTrait.php

in drupal:8.3.0 and is removed from drupal:10.0.0. Use $this->xpath() instead and check the values directly in the test.

function 4
AssertLegacyTrait::assertFieldChecked core/tests/Drupal/FunctionalTests/AssertLegacyTrait.php

in drupal:8.2.0 and is removed from drupal:10.0.0. Use $this->assertSession()->checkboxChecked() instead.

function 1
AssertLegacyTrait::assertFieldsByValue core/tests/Drupal/FunctionalTests/AssertLegacyTrait.php

in drupal:8.3.0 and is removed from drupal:10.0.0. Use iteration over the fields yourself instead and directly check the values in the test.

function 3
AssertLegacyTrait::assertHeader core/tests/Drupal/FunctionalTests/AssertLegacyTrait.php

in drupal:8.3.0 and is removed from drupal:10.0.0. Use $this->assertSession()->responseHeaderEquals() instead.

function 1
AssertLegacyTrait::assertIdentical core/tests/Drupal/KernelTests/AssertLegacyTrait.php

in drupal:8.0.0 and is removed from drupal:10.0.0. Use $this->assertSame() instead.

function 1
AssertLegacyTrait::assertIdenticalObject core/tests/Drupal/KernelTests/AssertLegacyTrait.php

in drupal:8.0.0 and is removed from drupal:10.0.0. Use $this->assertEquals() instead.

function 1
AssertLegacyTrait::assertLink core/tests/Drupal/FunctionalTests/AssertLegacyTrait.php

in drupal:8.2.0 and is removed from drupal:10.0.0. Use $this->assertSession()->linkExists() instead.

function
AssertLegacyTrait::assertLinkByHref core/tests/Drupal/FunctionalTests/AssertLegacyTrait.php

in drupal:8.2.0 and is removed from drupal:10.0.0. Use $this->assertSession()->linkByHrefExists() instead.

function 1
AssertLegacyTrait::assertNoCacheTag core/tests/Drupal/FunctionalTests/AssertLegacyTrait.php

in drupal:8.4.0 and is removed from drupal:10.0.0. Use $this->assertSession()->responseHeaderNotContains() instead.

function 1
AssertLegacyTrait::assertNoEscaped core/tests/Drupal/FunctionalTests/AssertLegacyTrait.php

in drupal:8.2.0 and is removed from drupal:10.0.0. Use $this->assertSession()->assertNoEscaped() instead.

function 1
AssertLegacyTrait::assertNoField core/tests/Drupal/FunctionalTests/AssertLegacyTrait.php

in drupal:8.2.0 and is removed from drupal:10.0.0. Use $this->assertSession()->fieldNotExists() or $this->assertSession()->buttonNotExists() instead.

function 1
AssertLegacyTrait::assertNoFieldById core/tests/Drupal/FunctionalTests/AssertLegacyTrait.php

in drupal:8.2.0 and is removed from drupal:10.0.0. Use $this->assertSession()->fieldNotExists() or $this->assertSession()->buttonNotExists() or $this->assertSession()->fieldValueNotEquals() instead.

function 1
AssertLegacyTrait::assertNoFieldByName core/tests/Drupal/FunctionalTests/AssertLegacyTrait.php

in drupal:8.2.0 and is removed from drupal:10.0.0. Use $this->assertSession()->fieldNotExists() or $this->assertSession()->buttonNotExists() or $this->assertSession()->fieldValueNotEquals() instead.

function 1
AssertLegacyTrait::assertNoFieldByXPath core/tests/Drupal/FunctionalTests/AssertLegacyTrait.php

in drupal:8.3.0 and is removed from drupal:10.0.0. Use $this->xpath() instead and assert that the result is empty.

function 4
AssertLegacyTrait::assertNoFieldChecked core/tests/Drupal/FunctionalTests/AssertLegacyTrait.php

in drupal:8.2.0 and is removed from drupal:10.0.0. Use $this->assertSession()->checkboxNotChecked() instead.

function 1
AssertLegacyTrait::assertNoLink core/tests/Drupal/FunctionalTests/AssertLegacyTrait.php

in drupal:8.2.0 and is removed from drupal:10.0.0. Use $this->assertSession()->linkNotExists() instead.

function
AssertLegacyTrait::assertNoLinkByHref core/tests/Drupal/FunctionalTests/AssertLegacyTrait.php

in drupal:8.2.0 and is removed from drupal:10.0.0. Use $this->assertSession()->linkByHrefNotExists() instead.

function 1
AssertLegacyTrait::assertNoOption core/tests/Drupal/FunctionalTests/AssertLegacyTrait.php

in drupal:8.2.0 and is removed from drupal:10.0.0. Use $this->assertSession()->optionNotExists() instead.

function 1
AssertLegacyTrait::assertNoPattern core/tests/Drupal/FunctionalTests/AssertLegacyTrait.php

in drupal:8.4.0 and is removed from drupal:10.0.0. Use $this->assertSession()->responseNotMatches() instead.

function 1
AssertLegacyTrait::assertNoRaw core/tests/Drupal/FunctionalTests/AssertLegacyTrait.php

in drupal:8.2.0 and is removed from drupal:10.0.0. Use $this->assertSession()->responseNotContains() instead.

function 1
AssertLegacyTrait::assertNotEqual core/tests/Drupal/KernelTests/AssertLegacyTrait.php

in drupal:8.0.0 and is removed from drupal:10.0.0. Use $this->assertNotEquals() instead.

function 1
AssertLegacyTrait::assertNoText core/tests/Drupal/FunctionalTests/AssertLegacyTrait.php

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.
function 1
AssertLegacyTrait::assertNotIdentical core/tests/Drupal/KernelTests/AssertLegacyTrait.php

in drupal:8.0.0 and is removed from drupal:10.0.0. Use $this->assertNotSame() instead.

function 1
AssertLegacyTrait::assertNoUniqueText core/tests/Drupal/FunctionalTests/AssertLegacyTrait.php

in drupal:8.2.0 and is removed from drupal:10.0.0. Instead, use $this->getSession()->pageTextMatchesCount() if you know the cardinality in advance, or $this->getSession()->getPage()->getText() and substr_count().

function 4
AssertLegacyTrait::assertOption core/tests/Drupal/FunctionalTests/AssertLegacyTrait.php

in drupal:8.2.0 and is removed from drupal:10.0.0. Use $this->assertSession()->optionExists() instead.

function 1
AssertLegacyTrait::assertOptionByText core/tests/Drupal/FunctionalTests/AssertLegacyTrait.php

in drupal:8.4.0 and is removed from drupal:10.0.0. Use $this->assertSession()->optionExists() instead.

function 1
AssertLegacyTrait::assertOptionSelected core/tests/Drupal/FunctionalTests/AssertLegacyTrait.php

in drupal:8.2.0 and is removed from drupal:10.0.0. Use $this->assertSession()->optionExists() instead and check the "selected" attribute yourself.

function 2
AssertLegacyTrait::assertPattern core/tests/Drupal/FunctionalTests/AssertLegacyTrait.php

in drupal:8.2.0 and is removed from drupal:10.0.0. Use $this->assertSession()->responseMatches() instead.

function 1
AssertLegacyTrait::assertRaw core/tests/Drupal/FunctionalTests/AssertLegacyTrait.php

in drupal:8.2.0 and is removed from drupal:10.0.0. Use $this->assertSession()->responseContains() instead.

function 1
AssertLegacyTrait::assertResponse core/tests/Drupal/FunctionalTests/AssertLegacyTrait.php

in drupal:8.2.0 and is removed from drupal:10.0.0. Use $this->assertSession()->statusCodeEquals() instead.

function 1
AssertLegacyTrait::assertText core/tests/Drupal/FunctionalTests/AssertLegacyTrait.php

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.
function 1
AssertLegacyTrait::assertTextHelper core/tests/Drupal/FunctionalTests/AssertLegacyTrait.php

in drupal:8.2.0 and is removed from drupal:10.0.0. Use $this->assertSession()->pageTextContains() or $this->assertSession()->pageTextNotContains() instead.

function 1
AssertLegacyTrait::assertTitle core/tests/Drupal/FunctionalTests/AssertLegacyTrait.php

in drupal:8.2.0 and is removed from drupal:10.0.0. Use $this->assertSession()->titleEquals() instead.

function 1
AssertLegacyTrait::assertUniqueText core/tests/Drupal/FunctionalTests/AssertLegacyTrait.php

in drupal:8.2.0 and is removed from drupal:10.0.0. Use $this->getSession()->pageTextContainsOnce() or $this->getSession()->pageTextMatchesCount() instead.

function 4
AssertLegacyTrait::assertUrl core/tests/Drupal/FunctionalTests/AssertLegacyTrait.php

in drupal:8.2.0 and is removed from drupal:10.0.0. Use $this->assertSession()->addressEquals() instead.

function 1

Other projects


Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.