BeSimpleSoap/tests/Fixtures/DummyServiceHandlerWithOutgoingLargeSwa.php
Petr Bechyně 564005da93 SoapServer/Client now handle binary files correctly & large tests/fixtures update
Soap Server and Client were breaking binary files during transfer due to invalid Mime Message Parser. Now is it working fine with no errors, but the message parser is about to be rewritten into a better form.
2017-04-04 18:36:18 +02:00

33 lines
1.1 KiB
PHP

<?php
namespace Fixtures;
use BeSimple\SoapServerAndSoapClientCommunicationTest;
use Fixtures\Attachment\Attachment;
use Fixtures\Attachment\AttachmentCollection;
class DummyServiceHandlerWithOutgoingLargeSwa
{
/**
* @param DummyServiceMethodWithOutgoingLargeSwaRequest $request
* @return DummyServiceMethodWithOutgoingLargeSwaResponse
*/
public function handle(DummyServiceMethodWithOutgoingLargeSwaRequest $request)
{
$response = new DummyServiceMethodWithOutgoingLargeSwaResponse();
$response->status = true;
$response->attachmentCollection = new AttachmentCollection([
new Attachment('filename.txt', 'text/plain', 'plaintext file'),
new Attachment('filename.html', 'text/html', '<html><body>Hello world</body></html>'),
new Attachment(
'filename.docx',
'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
file_get_contents(SoapServerAndSoapClientCommunicationTest::LARGE_SWA_FILE)
),
]);
return $response;
}
}