Skip to content

Commit

Permalink
[Notifier] Fix test with hard coded date in SmsboxTransportTest
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandre-daubois committed Nov 4, 2024
1 parent 2bc3a01 commit 6790914
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Tests/SmsboxTransportTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -206,17 +206,18 @@ public function testSmsboxOptionsInvalidDateTimeAndDate()
return $response;
});

$dateTime = new \DateTimeImmutable('+1 day');

$this->expectException(\InvalidArgumentException::class);
$this->expectExceptionMessage("Either Symfony\Component\Notifier\Bridge\Smsbox\SmsboxOptions::dateTime() or Symfony\Component\Notifier\Bridge\Smsbox\SmsboxOptions::date() and Symfony\Component\Notifier\Bridge\Smsbox\SmsboxOptions::hour() must be called, but not both.");
$dateTime = \DateTimeImmutable::createFromFormat('d/m/Y H:i', '01/11/2024 18:00', new \DateTimeZone('UTC'));
$message = new SmsMessage('+33612345678', 'Hello');

$smsboxOptions = (new SmsboxOptions())
->mode(Mode::Expert)
->sender('SENDER')
->strategy(Strategy::Marketing)
->dateTime($dateTime)
->date('01/01/2024');
->date($dateTime->format('d/m/Y'));

$transport = $this->createTransport($client);

Expand Down

0 comments on commit 6790914

Please sign in to comment.