Skip to content

[Notifier] Add SMSense bridge #53734

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
Feb 23, 2024
Merged

[Notifier] Add SMSense bridge #53734

merged 1 commit into from
Feb 23, 2024

Conversation

jimiero
Copy link
Contributor

@jimiero jimiero commented Feb 2, 2024

Q A
Branch? 7.1
Bug fix? no
New feature? yes
Deprecations? no
Issues none
License MIT

SMSense is a Romanian sms provider.

@carsonbot
Copy link

Hey!

I see that this is your first PR. That is great! Welcome!

Symfony has a contribution guide which I suggest you to read.

In short:

  • Always add tests
  • Keep backward compatibility (see https://symfony.com/bc).
  • Bug fixes must be submitted against the lowest maintained branch where they apply (see https://symfony.com/releases)
  • Features and deprecations must be submitted against the 7.1 branch.

Review the GitHub status checks of your pull request and try to solve the reported issues. If some tests are failing, try to see if they are failing because of this change.

When two Symfony core team members approve this change, it will be merged and you will become an official Symfony contributor!
If this PR is merged in a lower version branch, it will be merged up to all maintained branches within a few days.

I am going to sit back now and wait for the reviews.

Cheers!

Carsonbot

@OskarStark OskarStark requested review from fabpot and xabbuh February 7, 2024 10:45
@OskarStark OskarStark changed the title Added SMSense notifier bridge [Notifier] Add SMSense bridge Feb 7, 2024
Copy link
Member

@fabpot fabpot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The class prefix should be Smsense to avoid having a package named s-m-ense-notifier

@carsonbot carsonbot changed the title [Notifier] Add SMSense bridge Add SMSense bridge Feb 15, 2024
@jimiero
Copy link
Contributor Author

jimiero commented Feb 16, 2024

The class prefix should be Smsense to avoid having a package named s-m-ense-notifier

Made the changes

@fabpot
Copy link
Member

fabpot commented Feb 16, 2024

@jimiero Can you have a look at the tests, some are broken for this new notifier.

@OskarStark OskarStark changed the title Add SMSense bridge [Notifier] Add SMSense bridge Feb 16, 2024
@jimiero
Copy link
Contributor Author

jimiero commented Feb 16, 2024

@jimiero Can you have a look at the tests, some are broken for this new notifier.

Changed them and now the tests are not failing anymore.

@fabpot
Copy link
Member

fabpot commented Feb 19, 2024

@jimiero
Copy link
Contributor Author

jimiero commented Feb 19, 2024

@jimiero Tests are still broken apparently, see https://github.com/symfony/symfony/actions/runs/7955729597/job/21715188628?pr=53734#step:8:126

Works just fine if I do this instead

`$response = $this->createMock(ResponseInterface::class);
$response->method('getStatusCode')->willReturn(200);
$response->method('getContent')->willReturn(file_get_contents(DIR.'/Fixtures/success-response.json'));
$client = new MockHttpClient($response);
$transport = $this->createTransport($client);
$sentMessage = $transport->send(new SmsMessage('+40701111111', 'Hello!'));

    $this->assertInstanceOf(SentMessage::class, $sentMessage);
    $this->assertSame('63444830-5857-50da-d5f6-69f3719aa916', $sentMessage->getMessageId());`

if I do:

$response = new JsonMockResponse(file_get_contents(__DIR__.'/Fixtures/success-response.json'));

it fails seems, any suggestions?

@stloyd
Copy link
Contributor

stloyd commented Feb 19, 2024

My bad with suggestion to use that version of mock, you put encoded body into json mock which expects to get php array instead.

Either you can remove the fixture file and inject the php array into json mock or use again interface mock again.

@jimiero
Copy link
Contributor Author

jimiero commented Feb 19, 2024

My bad with suggestion to use that version of mock, you put encoded body into json mock which expects to get php array instead.

Either you can remove the fixture file and inject the php array into json mock or use again interface mock again.

Yep that was it, pushed changes by removing fixtures file and replaced JsonMockResponse input with a php array instead.

@fabpot
Copy link
Member

fabpot commented Feb 23, 2024

Thank you @jimiero.

@fabpot fabpot merged commit 17c5508 into symfony:7.1 Feb 23, 2024
@fabpot fabpot mentioned this pull request May 2, 2024
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.

6 participants