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

Breadcrumb

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

function LogToReportMigration::migrate

Throws

MigrationException

Overrides Migration::migrate

File

vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/LogToReportMigration.php, line 27

Class

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

Namespace

PHPUnit\TextUI\XmlConfiguration

Code

public function migrate(DOMDocument $document) : void {
    $coverage = $document->getElementsByTagName('coverage')
        ->item(0);
    if (!$coverage instanceof DOMElement) {
        throw new MigrationException('Unexpected state - No coverage element');
    }
    $logNode = $this->findLogNode($document);
    if ($logNode === null) {
        return;
    }
    $reportChild = $this->toReportFormat($logNode);
    $report = $coverage->getElementsByTagName('report')
        ->item(0);
    if ($report === null) {
        $report = $coverage->appendChild($document->createElement('report'));
    }
    $report->appendChild($reportChild);
    $logNode->parentNode
        ->removeChild($logNode);
}
RSS feed
Powered by Drupal