function BrowserTestBaseTest::testTearDownWithoutSetUp
Same name in other branches
- 9 core/tests/Drupal/Tests/Core/Test/BrowserTestBaseTest.php \Drupal\Tests\Core\Test\BrowserTestBaseTest::testTearDownWithoutSetUp()
- 8.9.x core/tests/Drupal/Tests/Core/Test/BrowserTestBaseTest.php \Drupal\Tests\Core\Test\BrowserTestBaseTest::testTearDownWithoutSetUp()
- 10 core/tests/Drupal/Tests/Core/Test/BrowserTestBaseTest.php \Drupal\Tests\Core\Test\BrowserTestBaseTest::testTearDownWithoutSetUp()
Tests that tearDown doesn't call cleanupEnvironment if setUp is not called.
@covers ::tearDown
File
-
core/
tests/ Drupal/ Tests/ Core/ Test/ BrowserTestBaseTest.php, line 82
Class
- BrowserTestBaseTest
- @coversDefaultClass \Drupal\Tests\BrowserTestBase @group Test
Namespace
Drupal\Tests\Core\TestCode
public function testTearDownWithoutSetUp() : void {
$method = 'cleanupEnvironment';
$this->assertTrue(method_exists(BrowserTestBase::class, $method));
$btb = $this->getMockBuilder(BrowserTestBaseMockableClass::class)
->disableOriginalConstructor()
->onlyMethods([
$method,
])
->getMock();
$btb->expects($this->never())
->method($method);
$ref_tearDown = new \ReflectionMethod($btb, 'tearDown');
$ref_tearDown->invoke($btb);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.