class RenderDeprecationTest
Tests deprecated render() function.
@group Render @group legacy
Hierarchy
- class \Drupal\FunctionalTests\Core\Render\RenderDeprecationTest
Expanded class hierarchy of RenderDeprecationTest
File
-
core/
tests/ Drupal/ FunctionalTests/ Core/ Render/ RenderDeprecationTest.php, line 14
Namespace
Drupal\FunctionalTests\Core\RenderView source
class RenderDeprecationTest extends BrowserTestBase {
/**
* {@inheritdoc}
*/
protected static $modules = [
'render_deprecation',
];
/**
* {@inheritdoc}
*/
protected $defaultTheme = 'stark';
/**
* Tests deprecated render() function.
*/
public function testRenderDeprecation() : void {
$this->expectDeprecation('The render() function is deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use \\Drupal\\Core\\Render\\RendererInterface::render() instead. See https://www.drupal.org/node/2939099');
$id = '#render-deprecation-test-result';
$this->drupalGet(Url::fromRoute('render_deprecation.function')->getInternalPath());
/** @var \Behat\Mink\Element\NodeElement $function_render */
$function_render = $this->getSession()
->getPage()
->find('css', $id);
$this->drupalGet(Url::fromRoute('render_deprecation.service')->getInternalPath());
/** @var \Behat\Mink\Element\NodeElement $service_render */
$service_render = $this->getSession()
->getPage()
->find('css', $id);
$this->assertEquals($service_render->getOuterHtml(), $function_render->getOuterHtml());
}
}
Members
Title Sort descending | Deprecated | Modifiers | Object type | Summary |
---|---|---|---|---|
AssertLegacyTrait::assert | Deprecated | protected | function | |
AssertLegacyTrait::assertCacheTag | Deprecated | protected | function | Asserts whether an expected cache tag was present in the last response. |
AssertLegacyTrait::assertElementNotPresent | Deprecated | protected | function | Asserts that the element with the given CSS selector is not present. |
AssertLegacyTrait::assertElementPresent | Deprecated | protected | function | Asserts that the element with the given CSS selector is present. |
AssertLegacyTrait::assertEqual | Deprecated | protected | function | |
AssertLegacyTrait::assertEscaped | Deprecated | protected | function | Passes if the raw text IS found escaped on the loaded page, fail otherwise. |
AssertLegacyTrait::assertField | Deprecated | protected | function | Asserts that a field exists with the given name or ID. |
AssertLegacyTrait::assertFieldById | Deprecated | protected | function | Asserts that a field exists with the given ID and value. |
AssertLegacyTrait::assertFieldByName | Deprecated | protected | function | Asserts that a field exists with the given name and value. |
AssertLegacyTrait::assertFieldByXPath | Deprecated | protected | function | Asserts that a field exists in the current page by the given XPath. |
AssertLegacyTrait::assertFieldChecked | Deprecated | protected | function | Asserts that a checkbox field in the current page is checked. |
AssertLegacyTrait::assertFieldsByValue | Deprecated | protected | function | Asserts that a field exists in the current page with a given Xpath result. |
AssertLegacyTrait::assertHeader | Deprecated | protected | function | Checks that current response header equals value. |
AssertLegacyTrait::assertIdentical | Deprecated | protected | function | |
AssertLegacyTrait::assertIdenticalObject | Deprecated | protected | function | |
AssertLegacyTrait::assertLink | Deprecated | protected | function | Passes if a link with the specified label is found. |
AssertLegacyTrait::assertLinkByHref | Deprecated | protected | function | Passes if a link containing a given href (part) is found. |
AssertLegacyTrait::assertNoCacheTag | Deprecated | protected | function | Asserts whether an expected cache tag was absent in the last response. |
AssertLegacyTrait::assertNoEscaped | Deprecated | protected | function | Passes if the raw text is not found escaped on the loaded page. |
AssertLegacyTrait::assertNoField | Deprecated | protected | function | Asserts that a field does NOT exist with the given name or ID. |
AssertLegacyTrait::assertNoFieldById | Deprecated | protected | function | Asserts that a field does not exist with the given ID and value. |
AssertLegacyTrait::assertNoFieldByName | Deprecated | protected | function | Asserts that a field does not exist with the given name and value. |
AssertLegacyTrait::assertNoFieldByXPath | Deprecated | protected | function | Asserts that a field does not exist or its value does not match, by XPath. |
AssertLegacyTrait::assertNoFieldChecked | Deprecated | protected | function | Asserts that a checkbox field in the current page is not checked. |
AssertLegacyTrait::assertNoLink | Deprecated | protected | function | Passes if a link with the specified label is not found. |
AssertLegacyTrait::assertNoLinkByHref | Deprecated | protected | function | Passes if a link containing a given href (part) is not found. |
AssertLegacyTrait::assertNoOption | Deprecated | protected | function | Asserts that a select option does NOT exist in the current page. |
AssertLegacyTrait::assertNoPattern | Deprecated | protected | function | Triggers a pass if the Perl regex pattern is not found in the raw content. |
AssertLegacyTrait::assertNoRaw | Deprecated | protected | function | Passes if the raw text IS not found on the loaded page, fail otherwise. |
AssertLegacyTrait::assertNotEqual | Deprecated | protected | function | |
AssertLegacyTrait::assertNoText | Deprecated | protected | function | Passes if the page (with HTML stripped) does not contains the text. |
AssertLegacyTrait::assertNotIdentical | Deprecated | protected | function | |
AssertLegacyTrait::assertNoUniqueText | Deprecated | protected | function | Passes if the text is found MORE THAN ONCE on the text version of the page. |
AssertLegacyTrait::assertOption | Deprecated | protected | function | Asserts that a select option in the current page exists. |
AssertLegacyTrait::assertOptionByText | Deprecated | protected | function | Asserts that a select option with the visible text exists. |
AssertLegacyTrait::assertOptionSelected | Deprecated | protected | function | Asserts that a select option in the current page is checked. |
AssertLegacyTrait::assertPattern | Deprecated | protected | function | Triggers a pass if the Perl regex pattern is found in the raw content. |
AssertLegacyTrait::assertRaw | Deprecated | protected | function | Passes if the raw text IS found on the loaded page, fail otherwise. |
AssertLegacyTrait::assertResponse | Deprecated | protected | function | Asserts the page responds with the specified response code. |
AssertLegacyTrait::assertText | Deprecated | protected | function | Passes if the page (with HTML stripped) contains the text. |
AssertLegacyTrait::assertTextHelper | Deprecated | protected | function | Helper for assertText and assertNoText. |
AssertLegacyTrait::assertTitle | Deprecated | protected | function | Pass if the page title is the given string. |
AssertLegacyTrait::assertUniqueText | Deprecated | protected | function | Passes if the text is found ONLY ONCE on the text version of the page. |
AssertLegacyTrait::assertUrl | Deprecated | protected | function | Passes if the internal browser's URL matches the given path. |
AssertLegacyTrait::buildXPathQuery | Deprecated | protected | function | Builds an XPath query. |
AssertLegacyTrait::constructFieldXpath | Deprecated | protected | function | Helper: Constructs an XPath for the given set of attributes and value. |
AssertLegacyTrait::getAllOptions | Deprecated | protected | function | Get all option elements, including nested options, in a select. |
AssertLegacyTrait::getRawContent | Deprecated | protected | function | Gets the current raw content. |
AssertLegacyTrait::pass | Deprecated | protected | function | |
AssertLegacyTrait::verbose | Deprecated | protected | function | |
PhpUnitWarnings::$deprecationWarnings | private static | property | Deprecation warnings from PHPUnit to raise with @trigger_error(). | |
PhpUnitWarnings::addWarning | public | function | Converts PHPUnit deprecation warnings to E_USER_DEPRECATED. | |
RenderDeprecationTest::$defaultTheme | protected | property | The theme to install as the default for testing. | |
RenderDeprecationTest::$modules | protected static | property | Modules to enable. | |
RenderDeprecationTest::testRenderDeprecation | public | function | Tests deprecated render() function. | |
StorageCopyTrait::replaceStorageContents | protected static | function | Copy the configuration from one storage to another and remove stale items. |
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.