Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. JunitXmlLogger.php

function JunitXmlLogger::handleFault

Throws

InvalidArgumentException

2 calls to JunitXmlLogger::handleFault()
JunitXmlLogger::testErrored in vendor/phpunit/phpunit/src/Logging/JUnit/JunitXmlLogger.php
JunitXmlLogger::testFailed in vendor/phpunit/phpunit/src/Logging/JUnit/JunitXmlLogger.php

File

vendor/phpunit/phpunit/src/Logging/JUnit/JunitXmlLogger.php, line 318

Class

JunitXmlLogger
@no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit

Namespace

PHPUnit\Logging\JUnit

Code

private function handleFault(Errored|Failed $event, string $type) : void {
    if (!$this->prepared) {
        $this->createTestCase($event);
    }
    assert($this->currentTestCase !== null);
    $buffer = $this->testAsString($event->test());
    $throwable = $event->throwable();
    $buffer .= trim($throwable->description() . PHP_EOL . $throwable->stackTrace());
    $fault = $this->document
        ->createElement($type, Xml::prepareString($buffer));
    $fault->setAttribute('type', $throwable->className());
    $this->currentTestCase
        ->appendChild($fault);
    if (!$this->prepared) {
        $this->handleFinish($event->telemetryInfo(), 0);
    }
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal