public function BrowserTestBaseTest::testTearDownWithoutSetUp in Drupal 8
Same name and namespace in other branches
- 9 core/tests/Drupal/Tests/Core/Test/BrowserTestBaseTest.php \Drupal\Tests\Core\Test\BrowserTestBaseTest::testTearDownWithoutSetUp()
Test that tearDown doesn't call cleanupEnvironment if setUp is not called.
@covers ::tearDown
File
- core/
tests/ Drupal/ Tests/ Core/ Test/ BrowserTestBaseTest.php, line 88
Class
- BrowserTestBaseTest
- @coversDefaultClass \Drupal\Tests\BrowserTestBase @group Test
Namespace
Drupal\Tests\Core\TestCode
public function testTearDownWithoutSetUp() {
$method = 'cleanupEnvironment';
$this
->assertTrue(method_exists(BrowserTestBase::class, $method));
$btb = $this
->getMockBuilder(BrowserTestBase::class)
->disableOriginalConstructor()
->setMethods([
$method,
])
->getMockForAbstractClass();
$btb
->expects($this
->never())
->method($method);
$ref_tearDown = new \ReflectionMethod($btb, 'tearDown');
$ref_tearDown
->setAccessible(TRUE);
$ref_tearDown
->invoke($btb);
}