Chris@0: getException(); Chris@0: $error = Error::decodeException($exception); Chris@0: Chris@0: $headers = []; Chris@0: Chris@0: // When running inside the testing framework, we relay the errors Chris@0: // to the tested site by the way of HTTP headers. Chris@0: if (DRUPAL_TEST_IN_CHILD_SITE && !headers_sent() && (!defined('SIMPLETEST_COLLECT_ERRORS') || SIMPLETEST_COLLECT_ERRORS)) { Chris@0: // $number does not use drupal_static as it should not be reset Chris@0: // as it uniquely identifies each PHP error. Chris@0: static $number = 0; Chris@0: $assertion = [ Chris@0: $error['@message'], Chris@0: $error['%type'], Chris@0: [ Chris@0: 'function' => $error['%function'], Chris@0: 'file' => $error['%file'], Chris@0: 'line' => $error['%line'], Chris@0: ], Chris@0: ]; Chris@0: $headers['X-Drupal-Assertion-' . $number] = rawurlencode(serialize($assertion)); Chris@0: $number++; Chris@0: } Chris@0: } Chris@0: Chris@0: }