Closed ivankovbas closed 7 years ago
Yeah I've had this issue since the very start.
Some non-optimal solutions
http://stackoverflow.com/questions/3221542/how-do-i-override-php-input-when-doing-unit-tests
http://news-from-the-basement.blogspot.ie/2011/07/mocking-phpinput.html
If you have any better suggestions please pass them on and make a PR too!
Still have this problem but don't know of a good way around it. Anyone else any clever solutions?
http://stackoverflow.com/questions/16296899/file-get-contentsphp-input-empty-in-unit-test
I've had an idea. Seems to be working!
PR coming!
I have a problem with laravel. the webhook is set but whenever a request is sent to my webhook I just want to log that it's working with "Log::info('webhook is working!');" but I get this error : "Illuminate\Session\TokenMismatchException" I tried to solve it by adding the route exceptions in protected $except in this file: app/Http/Middleware/VerifyCsrfToken.php but I'm still getting the error :( can you help me please?
@mobasher92 Create a new issue with your route codes and the $except
array, so we can verify and suggest something.
@mobasher92 your route seems to be setup in web middleware group. This include the check for CSRF token which is not sent from telegram. Just setup the route without web middleware and you are done.
Sorry: was reposted as own topix.
I did it in laravel 5.1. the $exception property is not supported in laravel 5 but in larvel 5.1 when I did the installation step in this doc: https://telegram-bot-sdk.readme.io/docs
I had a problem in this step:
php artisan vendor:publish --provider="Telegram\Bot\Laravel\TelegramServiceProvider"
I got the message that nothing to be published and telegram config file was not cpoied to config folder so i did it manually but after that when I wanted to user Telegram::... in my code I got this error that "Telegram class is not found ..."
why? how can i specify in code that where is the Telegram class I am using?
Please refer this example starter: https://github.com/irazasyed/telegram-bot-laravel-starter
Closing this issue as it's quite old now. But feel free to create a new one after testing the above starter. Thanks!
Hi! I'm using the SDK in my Laravel project and I want to write functional tests like this:
post
method emulates Request object, but notphp://input
. So the SDK can't populate Update object correctly cause of that: https://github.com/irazasyed/telegram-bot-sdk/blob/master/src/Api.php#L966So, how can I write my tests?