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

Breadcrumb

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

function TestCase::stopOutputBuffering

Throws

MoreThanOneDataSetFromDataProviderException

1 call to TestCase::stopOutputBuffering()
TestCase::runBare in vendor/phpunit/phpunit/src/Framework/TestCase.php
@internal This method is not covered by the backward compatibility promise for PHPUnit

File

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

Class

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

Namespace

PHPUnit\Framework

Code

private function stopOutputBuffering() : bool {
    $bufferingLevel = ob_get_level();
    if ($bufferingLevel !== $this->outputBufferingLevel) {
        if ($bufferingLevel > $this->outputBufferingLevel) {
            $message = 'Test code or tested code did not close its own output buffers';
        }
        else {
            $message = 'Test code or tested code closed output buffers other than its own';
        }
        while (ob_get_level() >= $this->outputBufferingLevel) {
            ob_end_clean();
        }
        Event\Facade::emitter()->testConsideredRisky($this->valueObjectForEvents(), $message);
        $this->status = TestStatus::risky($message);
        return false;
    }
    $this->output = ob_get_clean();
    $this->outputBufferingActive = false;
    $this->outputBufferingLevel = ob_get_level();
    return true;
}
RSS feed
Powered by Drupal