You are here

class StreamCapturer in Drupal 10

Same name and namespace in other branches
  1. 9 core/tests/Drupal/Tests/StreamCapturer.php \Drupal\Tests\StreamCapturer

Captures output to a stream and stores it for retrieval.

Hierarchy

  • class \Drupal\Tests\StreamCapturer extends \Drupal\Tests\php_user_filter

Expanded class hierarchy of StreamCapturer

2 files declare their use of StreamCapturer
BrowserTestBaseTest.php in core/tests/Drupal/FunctionalTests/BrowserTestBaseTest.php
KernelTestBaseTest.php in core/tests/Drupal/KernelTests/KernelTestBaseTest.php

File

core/tests/Drupal/Tests/StreamCapturer.php, line 8

Namespace

Drupal\Tests
View source
class StreamCapturer extends \php_user_filter {
  public static $cache = '';

  #[\ReturnTypeWillChange]
  public function filter($in, $out, &$consumed, $closing) {
    while ($bucket = stream_bucket_make_writeable($in)) {
      self::$cache .= $bucket->data;

      // cSpell:disable-next-line
      $consumed += $bucket->datalen;
      stream_bucket_append($out, $bucket);
    }

    // cSpell:disable-next-line
    return PSFS_FEED_ME;
  }

}

Members