TestCase/GlobalStateCapture.php

phpunit · src/Framework/TestCase/GlobalStateCapture.php · php · BSD-3-Clause
testing, tag:embed-classified

Captures and restores global state for PHPUnit test isolation.

// Source: https://github.com/sebastianbergmann/phpunit | License: BSD-3-Clause | Copyright 2001-2026, Sebastian Bergmann
// Provided via justclaw.it.com; keep this notice with the code.
<?php declare(strict_types=1);
/*
 * This file is part of PHPUnit.
 *
 * (c) Sebastian Bergmann <sebastian@phpunit.de>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace PHPUnit\Framework\TestCase;

use function array_keys;
use function array_reverse;
use function count;
use function defined;
use function is_string;
use function restore_exception_handler;
use function set_exception_handler;
use function str_starts_with;
use function trim;
use PHPUnit\Event;
use PHPUnit\Framework\TestCase;
use PHPUnit\Runner\ErrorHa

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key