- Open directory
/tests/RealTelegramApi/. - Copy
RealTelegramApiTest.dist.phptoRealTelegramApiTest.php. - Add your bot authentication token to constant
TOKENinRealTelegramApiTest.php, for example:
// ...
final class RealTelegramApiTest extends TestCase
{
private const TOKEN = '110201543:AAHdqTcvCH1vGWJxfSeofSAs0K5PALDsaw';
// ...- Put your test code into
testBase()method inRealTelegramApiTest.php. - Run tests with real Telegram bot API via PHPUnit:
./vendor/bin/phpunit --group=realApi
# or
composer test-realThe package is tested with PHPUnit. To run tests:
./vendor/bin/phpunitThe package tests are checked with Infection mutation framework. To run it:
composer infectionThe code is statically analyzed with Psalm. To run static analysis:
./vendor/bin/psalmPackage used PHP CS Fixer to maintain PER CS 2.0 code style. To check and fix code style:
composer cs-fixUse ComposerRequireChecker to detect transitive Composer dependencies:
./vendor/bin/composer-require-checker