Skip to content
Snippets Groups Projects

Throw PhpWatchdogException at the end of the tearDown process

Merged Raf Philtjens requested to merge issue/dtt-3471948:2.x into 2.x
1 file
+ 5
1
Compare changes
  • Side-by-side
  • Inline
+ 5
1
@@ -63,6 +63,7 @@ abstract class ExistingSiteBase extends TestCase implements LoggerInterface
*/
protected function tearDown(): void
{
$messages = [];
if ($this->failOnPhpWatchdogMessages && \Drupal::database()->schema()->tableExists('watchdog')) {
$messages = \Drupal::database()
->select('watchdog', 'w')
@@ -80,13 +81,16 @@ abstract class ExistingSiteBase extends TestCase implements LoggerInterface
unset($error->variables);
print_r($error);
}
throw new PhpWatchdogException('PHP errors or warnings are introduced when running this test.');
}
}
parent::tearDown();
$this->tearDownDrupal();
$this->tearDownMinkSession();
if (!empty($messages)) {
throw new PhpWatchdogException('PHP errors or warnings are introduced when running this test.');
}
}
/**
Loading