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

Breadcrumb

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

function TestCase::compareGlobalStateSnapshotPart

Throws

MoreThanOneDataSetFromDataProviderException

1 call to TestCase::compareGlobalStateSnapshotPart()
TestCase::compareGlobalStateSnapshots in vendor/phpunit/phpunit/src/Framework/TestCase.php

File

vendor/phpunit/phpunit/src/Framework/TestCase.php, line 1874

Class

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

Namespace

PHPUnit\Framework

Code

private function compareGlobalStateSnapshotPart(array $before, array $after, string $header) : void {
    if ($before != $after) {
        $differ = new Differ(new UnifiedDiffOutputBuilder($header));
        $exporter = new Exporter();
        Event\Facade::emitter()->testConsideredRisky($this->valueObjectForEvents(), 'This test modified global state but was not expected to do so' . PHP_EOL . trim($differ->diff($exporter->export($before), $exporter->export($after))));
    }
}
RSS feed
Powered by Drupal