Skip to content

Commit d846c6e

Browse files
minor symfony#58745 [Notifier] Fix test with hard coded date in SmsboxTransportTest (alexandre-daubois)
This PR was merged into the 7.1 branch. Discussion ---------- [Notifier] Fix test with hard coded date in `SmsboxTransportTest` | Q | A | ------------- | --- | Branch? | 7.1 | Bug fix? | yes | New feature? | no | Deprecations? | no | Issues | - | License | MIT Fixes CI, see https://github.com/symfony/symfony/actions/runs/11654514385/job/32448126831#step:8:1756. Commits ------- 2ee5364 [Notifier] Fix test with hard coded date in `SmsboxTransportTest`
2 parents 92d3288 + 2ee5364 commit d846c6e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/Symfony/Component/Notifier/Bridge/Smsbox/Tests/SmsboxTransportTest.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,17 +206,18 @@ public function testSmsboxOptionsInvalidDateTimeAndDate()
206206
return $response;
207207
});
208208

209+
$dateTime = new \DateTimeImmutable('+1 day');
210+
209211
$this->expectException(\InvalidArgumentException::class);
210212
$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.");
211-
$dateTime = \DateTimeImmutable::createFromFormat('d/m/Y H:i', '01/11/2024 18:00', new \DateTimeZone('UTC'));
212213
$message = new SmsMessage('+33612345678', 'Hello');
213214

214215
$smsboxOptions = (new SmsboxOptions())
215216
->mode(Mode::Expert)
216217
->sender('SENDER')
217218
->strategy(Strategy::Marketing)
218219
->dateTime($dateTime)
219-
->date('01/01/2024');
220+
->date($dateTime->format('d/m/Y'));
220221

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

0 commit comments

Comments
 (0)