function SerializeResponseTest::testSerialize

Same name and namespace in other branches
  1. 11.x core/modules/big_pipe/tests/src/Kernel/SerializeResponseTest.php \Drupal\Tests\big_pipe\Kernel\SerializeResponseTest::testSerialize()

Tests that big_pipe responses can be serialized.

Throws

\Exception

File

core/modules/big_pipe/tests/src/Kernel/SerializeResponseTest.php, line 30

Class

SerializeResponseTest
Tests that big_pipe responses can be serialized.

Namespace

Drupal\Tests\big_pipe\Kernel

Code

public function testSerialize() : void {
  $response = new BigPipeResponse(new HtmlResponse());
  $this->assertIsString(serialize($response));
  // Checks that the response can be serialized after the big_pipe service is injected.
  $response->setBigPipeService($this->container
    ->get('big_pipe'));
  $this->assertIsString(serialize($response));
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.