File tree Expand file tree Collapse file tree 2 files changed +19
-1
lines changed
modules/simpletest/src/Tests
tests/Drupal/Tests/Core/Test Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Original file line number Diff line number Diff line change 1212 * database tables. Therefore, we ensure that tests which are not set up
1313 * properly are skipped.
1414 *
15- * @group simpletest
15+ * @group WebTestBase
1616 * @see \Drupal\simpletest\WebTestBase
1717 */
1818class BrokenSetUpTest extends WebTestBase {
Original file line number Diff line number Diff line change @@ -79,4 +79,22 @@ public function testGetHttpClientException() {
7979 $ ref_gethttpclient ->invoke ($ btb );
8080 }
8181
82+ /**
83+ * Test that tearDown doesn't call cleanupEnvironment if setUp is not called.
84+ *
85+ * @covers ::tearDown
86+ */
87+ public function testTearDownWithoutSetUp () {
88+ $ method = 'cleanupEnvironment ' ;
89+ $ this ->assertTrue (method_exists (BrowserTestBase::class, $ method ));
90+ $ btb = $ this ->getMockBuilder (BrowserTestBase::class)
91+ ->disableOriginalConstructor ()
92+ ->setMethods ([$ method ])
93+ ->getMockForAbstractClass ();
94+ $ btb ->expects ($ this ->never ())->method ($ method );
95+ $ ref_tearDown = new \ReflectionMethod ($ btb , 'tearDown ' );
96+ $ ref_tearDown ->setAccessible (TRUE );
97+ $ ref_tearDown ->invoke ($ btb );
98+ }
99+
82100}
You can’t perform that action at this time.
0 commit comments