Skip to content

[Notifier] Transport possible to have null #51276

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 2, 2023

Conversation

StaffNowa
Copy link
Contributor

@StaffNowa StaffNowa commented Aug 4, 2023

Q A
Branch? 6.4
Bug fix? no
New feature? yes
Deprecations? no
Tickets Fix #51236
License MIT

My test example of why I need to have properly transport null

public function testSmsSending(): void
{
    $date = (new \DateTimeImmutable())->format('Y-m-d');

    $stateta = new Stateta();
    $stateta->setDate(new \DateTimeImmutable($date));
    $stateta->setA95(0);
    $stateta->setDk(0);

    $this->entityManager->persist($stateta);
    $this->entityManager->flush();

    $this->commandTester->execute([], [
        'verbosity' => OutputInterface::VERBOSITY_DEBUG
    ]);

    $this->commandTester->assertCommandIsSuccessful();

    $notifierEvent = $this->getNotifierEvent();

    self::assertEquals(null, $notifierEvent->getMessage()->getTransport());
    self::assertEquals("+37061234567", $notifierEvent->getMessage()->getRecipientId());

    self::assertNotificationIsQueued($notifierEvent);
    self::assertNotificationSubjectContains($notifierEvent->getMessage(), 'Company name');
    self::assertNotificationTransportIsEqual($notifierEvent->getMessage(), null);
}

@StaffNowa
Copy link
Contributor Author

Double checked my test case, and I see I can validate it as and 'null.'

@fabpot
Copy link
Member

fabpot commented Oct 2, 2023

Thank you @StaffNowa.

@fabpot fabpot merged commit 96687e3 into symfony:6.4 Oct 2, 2023
@StaffNowa StaffNowa deleted the notifier-transport-null branch October 2, 2023 19:09
OskarStark added a commit to OskarStark/symfony that referenced this pull request Oct 3, 2023
nicolas-grekas added a commit that referenced this pull request Oct 3, 2023
This PR was merged into the 6.4 branch.

Discussion
----------

[Notifier] Fix failing testcase

| Q             | A
| ------------- | ---
| Branch?       | 6.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | #51276
| License       | MIT

Follows
* #51276

Commits
-------

f7384f4 [Notifier] Fix failing testcase
symfony-splitter pushed a commit to symfony/notifier that referenced this pull request Oct 3, 2023
This was referenced Oct 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants