UnitTests are now located in tests directory & tiny improvements

This commit is contained in:
Petr Bechyně
2017-03-15 10:25:48 +01:00
parent 21d705bbfa
commit d3023b1a5a
115 changed files with 206 additions and 3816 deletions

View File

@ -0,0 +1,30 @@
<?php
namespace Fixtures;
use Fixtures\Attachment\Attachment;
use Fixtures\Attachment\AttachmentCollection;
class DummyServiceHandlerWithAttachments
{
/**
* @param DummyServiceRequestWithAttachments $request
* @return DummyServiceResponseWithAttachments
*/
public function handle(DummyServiceRequestWithAttachments $request)
{
$response = new DummyServiceResponseWithAttachments();
$response->status = true;
if ($request->includeAttachments === true) {
if ($request->hasAttachments() === true) {
$attachments = [];
foreach ($request->attachmentCollection->attachments as $attachment) {
$attachments[] = new Attachment($attachment->fileName, $attachment->contentType, $attachment->content);
}
$response->attachmentCollection = new AttachmentCollection($attachments);
}
}
return $response;
}
}