Skip to content

Commit

Permalink
Merge branch '6.4' into 7.0
Browse files Browse the repository at this point in the history
* 6.4: (33 commits)
  [Console][FrameworkBundle][HttpKernel][WebProfilerBundle] Enable profiling commands
  [AssetMapper] Disable profiler when the "dev server" respond
  Adds translations for Portuguese (pt)
  [AssetMapper] Link needs as="style"
  Allow Symfony 7.0 on Phrase translation provider
  [Mime] Throw InvalidArgumentException on invalid form field type inside array
  [Mailer][Bridges] Allow Symfony 7
  [Tests] Use `JsonMockResponse` where applicable
  [FrameworkBundle][HttpKernel] Introduce `$buildDir` argument to `WarmableInterface::warmup` to warm read-only artefacts in `build_dir`
  [ErrorHandler] Fix expected missing return types
  [Form] Fix merging params & files when "multiple" is enabled
  [HttpFoundation] Do not swallow trailing `=` in cookie value
  Fix markdown in README files
  Handle Sendinblue error responses without a message key
  Handle Brevo error responses without a message key
  [Scheduler] Add failureEvent
  [Notifier][Bridges] Allow Symfony 7
  [Mailer][Brevo][Sendinblue] Fix typo
  [Serializer] Fix collecting only first missing constructor argument
  [ErrorHandler] Fix file link format call in trace view
  ...
  • Loading branch information
nicolas-grekas committed Oct 17, 2023
2 parents c464a8c + c85c15e commit 9093683
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions Tests/Transport/PostmarkApiTransportTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

use PHPUnit\Framework\TestCase;
use Symfony\Component\HttpClient\MockHttpClient;
use Symfony\Component\HttpClient\Response\MockResponse;
use Symfony\Component\HttpClient\Response\JsonMockResponse;
use Symfony\Component\Mailer\Bridge\Postmark\Transport\MessageStreamHeader;
use Symfony\Component\Mailer\Bridge\Postmark\Transport\PostmarkApiTransport;
use Symfony\Component\Mailer\Envelope;
Expand Down Expand Up @@ -82,7 +82,7 @@ public function testSend()
$this->assertSame('Hello!', $body['Subject']);
$this->assertSame('Hello There!', $body['TextBody']);

return new MockResponse(json_encode(['MessageID' => 'foobar']), [
return new JsonMockResponse(['MessageID' => 'foobar'], [
'http_code' => 200,
]);
});
Expand All @@ -102,11 +102,8 @@ public function testSend()

public function testSendThrowsForErrorResponse()
{
$client = new MockHttpClient(static fn (string $method, string $url, array $options): ResponseInterface => new MockResponse(json_encode(['Message' => 'i\'m a teapot', 'ErrorCode' => 418]), [
$client = new MockHttpClient(static fn (string $method, string $url, array $options): ResponseInterface => new JsonMockResponse(['Message' => 'i\'m a teapot', 'ErrorCode' => 418], [
'http_code' => 418,
'response_headers' => [
'content-type' => 'application/json',
],
]));
$transport = new PostmarkApiTransport('KEY', $client);
$transport->setPort(8984);
Expand Down

0 comments on commit 9093683

Please sign in to comment.