You are here

private function PHPUnit_Framework_TestCase::stopOutputBuffering in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/phpunit/phpunit/src/Framework/TestCase.php \PHPUnit_Framework_TestCase::stopOutputBuffering()

@since Method available since Release 4.2.0

1 call to PHPUnit_Framework_TestCase::stopOutputBuffering()
PHPUnit_Framework_TestCase::runBare in vendor/phpunit/phpunit/src/Framework/TestCase.php
Runs the bare test sequence.

File

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

Class

PHPUnit_Framework_TestCase
A TestCase defines the fixture to run multiple tests.

Code

private function stopOutputBuffering() {
  if (ob_get_level() != $this->outputBufferingLevel) {
    while (ob_get_level() > 0) {
      ob_end_clean();
    }
    throw new PHPUnit_Framework_RiskyTestError('Test code or tested code did not (only) close its own output buffers');
  }
  $output = ob_get_contents();
  if ($this->outputCallback === false) {
    $this->output = $output;
  }
  else {
    $this->output = call_user_func_array($this->outputCallback, array(
      $output,
    ));
  }
  ob_end_clean();
  $this->outputBufferingActive = false;
  $this->outputBufferingLevel = ob_get_level();
}