Stas Coder
Stas Coder

Reputation: 347

Make sure third party API works properly in Laravel or any other PHP framework

I have an app that makes requests to Google places and another third party API and I need to know that these APIs work properly. What are the best practices to support them working?

Is it a good solution if I run PHPUnit tests in production server with cron jobs and if they fail, I will send email to a programmer?

Upvotes: 0

Views: 238

Answers (2)

Gayan
Gayan

Reputation: 3704

If the package comes with tests its always good idea to run them.

You can even find third party error monitoring servises like bugsnag and honeybadger useful to track exceptions and errors in production environment.

Upvotes: 1

Loek
Loek

Reputation: 4135

That seems like a pretty good solution. It doesn't have to be PHPUnit per se. You could just run a small script that requests some information (or even ping for that matter), check if that information is correct and send an email to the admin if it isn't.

As said, you could even just run a CRON with a ping that sends an email as soon as the ping times out.

Upvotes: 1

Related Questions