You are here

public function BlueprintManagerTest::testCombineResponses in Subrequests 8.2

Same name and namespace in other branches
  1. 3.x tests/src/Unit/Blueprint/BlueprintManagerTest.php \Drupal\Tests\subrequests\Unit\Blueprint\BlueprintManagerTest::testCombineResponses()

@covers ::combineResponses

File

tests/src/Unit/Blueprint/BlueprintManagerTest.php, line 65

Class

BlueprintManagerTest
@coversDefaultClass \Drupal\subrequests\Blueprint\BlueprintManager @group subrequests

Namespace

Drupal\Tests\subrequests\Unit\Blueprint

Code

public function testCombineResponses() {
  $responses = [
    Response::create('foo', 200, [
      'lorem' => 'ipsum',
      'Content-Type' => 'sparrow',
    ]),
    Response::create('bar', 201, [
      'dolor' => 'sid',
      'Content-Type' => 'sparrow',
    ]),
  ];
  $combined = $this->sut
    ->combineResponses($responses, 'multipart-related');
  $this
    ->assertInstanceOf(CacheableResponse::class, $combined);
  $this
    ->assertSame('Ha!', $combined->headers
    ->get('head'));
  $this
    ->assertSame('Booh!', $combined
    ->getContent());
}