createBigPipeResponseAttachmentsProcessor example


class BigPipeResponseAttachmentsProcessorTest extends UnitTestCase {

  /** * @covers ::processAttachments * * @dataProvider nonHtmlResponseProvider */
  public function testNonHtmlResponse($response_class) {
    $big_pipe_response_attachments_processor = $this->createBigPipeResponseAttachmentsProcessor($this->prophesize(AttachmentsResponseProcessorInterface::class));

    $non_html_response = new $response_class();
    $this->expectException(\AssertionError::class);
    $big_pipe_response_attachments_processor->processAttachments($non_html_response);
  }

  public static function nonHtmlResponseProvider() {
    return [
      'AjaxResponse, which implements AttachmentsInterface' => [AjaxResponse::class],
      'A dummy that implements AttachmentsInterface' => [get_class((new Prophet())->prophesize(AttachmentsInterface::class)->reveal())],
    ];
  }
Home | Imprint | This part of the site doesn't use cookies.