You are here

public static function TestSubContext::flagPhpSuiteErrors in Panopoly 7

Same name and namespace in other branches
  1. 8.2 modules/panopoly/panopoly_test/behat/steps/panopoly_test.behat.inc \TestSubContext::flagPhpSuiteErrors()

Fail the suite if any PHP notices are logged.

@AfterSuite

File

modules/panopoly/panopoly_test/behat/steps/panopoly_test.behat.inc, line 223
Provide Behat step-definitions for generic Panopoly tests.

Class

TestSubContext

Code

public static function flagPhpSuiteErrors() {
  if (getenv('PANOPOLY_BEHAT_FLAG_PHP_NOTICES') != self::PANOPOLY_BEHAT_FLAG_PHP_NOTICES_OFF) {
    $number_of_rows = db_select('watchdog', 'w')
      ->fields('w', [])
      ->condition('w.type', 'behat', '=')
      ->countQuery()
      ->execute()
      ->fetchField();
    if ($number_of_rows > 0) {
      print "PHP errors were logged. See scenario output for details.\n";
    }
  }
}