Add Pest tests for Laravel integration using Orchestra Testbench #16
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.