'AjaxResponse, which implements AttachmentsInterface' =>
[AjaxResponse::
class],
'A dummy that implements AttachmentsInterface' =>
[get_class((new Prophet())->
prophesize(AttachmentsInterface::
class)->
reveal())],
];
} /**
* @covers ::processAttachments
*
* @dataProvider attachmentsProvider
*/
public function testHtmlResponse(array
$attachments) { $big_pipe_response =
new BigPipeResponse(new HtmlResponse('original'
));
$big_pipe_response->
setAttachments($attachments);
// This mock is the main expectation of this test: verify that the decorated
// service (that is this mock) never receives BigPipe placeholder
// attachments, because it doesn't know (nor should it) how to handle them.
$html_response_attachments_processor =
$this->
prophesize(AttachmentsResponseProcessorInterface::
class);
$html_response_attachments_processor->
processAttachments(Argument::
that(function D
$response) { return $response instanceof HtmlResponse &&
empty(array_intersect(['big_pipe_placeholders', 'big_pipe_nojs_placeholders'
],
array_keys($response->
getAttachments())));
})) ->
will(function D
$args) { /** @var \Symfony\Component\HttpFoundation\Response|\Drupal\Core\Render\AttachmentsInterface $response */