Skip to content

Add Pest tests for Laravel integration using Orchestra Testbench #16

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

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

jonnywilliamson
Copy link
Contributor

Add Pest tests for Laravel integration using Orchestra Testbench

This commit introduces a new suite of Pest PHP tests to validate the Laravel integration of the Telegram Bot SDK wrapper.

Tests cover key areas including service provider and facade registration, configuration loading, route definitions, console commands, webhook handling, and custom command/listener functionality. Orchestra Testbench is utilized to provide a minimal Laravel application environment, ensuring robust and isolated testing of the Laravel-specific components.

Fix:
Make TelegramServiceProvider non-deferrable to ensure routes are registered

Description:
This change removes DeferrableProvider from TelegramServiceProvider to ensure that routes are registered during development.

When the provider is deferred, Laravel does not the routes from this package until one of its bindings is resolved. This prevents the webhook routes from being registered, resulting in 404 errors during development when route caching is not in use. This can cause a lot of confusion during developement because the production server does not tend to suffer the same issue as all routes are cached.

The provides() method has also been removed, as it is only relevant for deferred providers.

This aligns development behavior with production, where route:cache ensures the provider is loaded.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant