function BrowserTestBase::setUp
Same name and namespace in other branches
- 11.x core/tests/Drupal/Tests/BrowserTestBase.php \Drupal\Tests\BrowserTestBase::setUp()
- 10 core/tests/Drupal/Tests/BrowserTestBase.php \Drupal\Tests\BrowserTestBase::setUp()
- 9 core/tests/Drupal/Tests/BrowserTestBase.php \Drupal\Tests\BrowserTestBase::setUp()
- 8.9.x core/tests/Drupal/Tests/BrowserTestBase.php \Drupal\Tests\BrowserTestBase::setUp()
236 methods override BrowserTestBase::setUp()
- ActiveWorkspaceUpdateTest::setUp in core/
modules/ workspaces/ tests/ src/ Functional/ UpdateSystem/ ActiveWorkspaceUpdateTest.php - AddedStylesheetsTest::setUp in core/
modules/ ckeditor5/ tests/ src/ Functional/ AddedStylesheetsTest.php - AdminPathEntityConverterLanguageTest::setUp in core/
modules/ language/ tests/ src/ Functional/ AdminPathEntityConverterLanguageTest.php - AjaxBlockTest::setUp in core/
modules/ layout_builder/ tests/ src/ FunctionalJavascript/ AjaxBlockTest.php - BlockFilterTest::setUp in core/
modules/ layout_builder/ tests/ src/ FunctionalJavascript/ BlockFilterTest.php
File
-
core/
tests/ Drupal/ Tests/ BrowserTestBase.php, line 333
Class
- BrowserTestBase
- Provides a test case for functional Drupal tests.
Namespace
Drupal\TestsCode
protected function setUp() : void {
if ($this->valueObjectForEvents()
->metadata()
->isRunTestsInSeparateProcesses()
->isEmpty()) {
@trigger_error('Functional/FunctionalJavascript test classes must specify the #[RunTestsInSeparateProcesses] attribute, not doing so is deprecated in drupal:11.3.0 and is throwing an exception in drupal:12.0.0. See https://www.drupal.org/node/3548485', E_USER_DEPRECATED);
}
parent::setUp();
$this->setUpAppRoot();
chdir($this->root);
// Allow tests to compare MarkupInterface objects via assertEquals().
$this->registerComparator(new MarkupInterfaceComparator());
$this->setupBaseUrl();
// Install Drupal test site.
$this->prepareEnvironment();
$this->installDrupal();
// Setup Mink. Register Mink exceptions to cause test failures instead of
// errors.
$this->registerFailureType(MinkException::class);
$this->initMink();
// Set up the browser test output file.
$this->initBrowserOutputFile();
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.