Unverified Commit eb3e150d authored by alexpott's avatar alexpott

Issue #2981870 by Lendude, alexpott: Duplicate BrokenSetUpTest for BrowserTestBase

(cherry picked from commit 4da678eb)
parent 6531ee4b
......@@ -12,7 +12,7 @@
* database tables. Therefore, we ensure that tests which are not set up
* properly are skipped.
*
* @group simpletest
* @group WebTestBase
* @see \Drupal\simpletest\WebTestBase
*/
class BrokenSetUpTest extends WebTestBase {
......
......@@ -79,4 +79,22 @@ public function testGetHttpClientException() {
$ref_gethttpclient->invoke($btb);
}
/**
* Test that tearDown doesn't call cleanupEnvironment if setUp is not called.
*
* @covers ::tearDown
*/
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);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment