Skip to content

Latest commit

 

History

History
74 lines (51 loc) · 1.6 KB

internals.md

File metadata and controls

74 lines (51 loc) · 1.6 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
# or
composer test-real

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. To run it:

composer infection

Static analysis

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

./vendor/bin/phpstan

Code style

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

composer cs-fix

Refactoring

The code is refactored with Rector. To apply it:

composer rector

Dependencies

Use Composer Dependency Analyser to detect unused, shadow and misplaced Composer dependencies:

composer dependency-analyser