Skip to content

Latest commit

 

History

History
65 lines (45 loc) · 1.56 KB

internals.md

File metadata and controls

65 lines (45 loc) · 1.56 KB

Internals

Manual testing with real telegram bot API

  • Open directory /tests/RealTelegramApi/.
  • Copy RealTelegramApiTest.dist.php to RealTelegramApiTest.php.
  • Add your bot authentication token to constant TOKEN in RealTelegramApiTest.php, for example:
// ...
final class RealTelegramApiTest extends TestCase
{
    private const TOKEN = '110201543:AAHdqTcvCH1vGWJxfSeofSAs0K5PALDsaw';
// ...
  • Put your test code into testBase() method in RealTelegramApiTest.php.
  • Run tests with real Telegram bot API via PHPUnit:
./vendor/bin/phpunit --group=realApi

Unit testing

The package is tested with PHPUnit. To run tests:

./vendor/bin/phpunit

Mutation testing

The package tests are checked with Infection mutation framework with Infection Static Analysis Plugin. To run it:

./vendor/bin/roave-infection-static-analysis-plugin

Static analysis

The code is statically analyzed with Psalm. To run static analysis:

./vendor/bin/psalm

Code style

Package used PHP CS Fixer to maintain PER CS 2.0 code style. To check and fix code style:

composer cs-fix

Dependencies

Use ComposerRequireChecker to detect transitive Composer dependencies:

./vendor/bin/composer-require-checker