Skip to content

Add unit tests for System\Telegram support utilities#3

Draft
ismailian wants to merge 10 commits intomainfrom
codex/add-unit-tests-to-system-telegram
Draft

Add unit tests for System\Telegram support utilities#3
ismailian wants to merge 10 commits intomainfrom
codex/add-unit-tests-to-system-telegram

Conversation

@ismailian
Copy link
Copy Markdown
Owner

Motivation

  • Provide unit coverage for Telegram support utilities to catch regressions in entity building and hydration logic.
  • Verify EntityBuilder behavior for chained entity construction, optional fields, and textMention serialization.
  • Ensure Hydrator correctly maps attribute-driven properties including nested objects, arrays, enums, DateTime conversion, and self-payload mapping.

Description

  • Add tests/Unit/System/Telegram/Support/EntityBuilderTest.php covering insertion order, optional field omission, and textMention user serialization.
  • Add tests/Unit/System/Telegram/Support/HydratorTest.php covering scalar mapping, object mapping, array-of-objects mapping, enum mapping, DateTime conversion, and MapProp(':', ...) self payload behavior.
  • Add phpunit.xml test configuration and update composer.json with autoload-dev for Tests\, a test script (phpunit), and a require-dev entry for phpunit/phpunit.

Testing

  • php -l tests/Unit/System/Telegram/Support/EntityBuilderTest.php and php -l tests/Unit/System/Telegram/Support/HydratorTest.php both reported no syntax errors.
  • Attempt to install PHPUnit via composer update phpunit/phpunit --with-all-dependencies failed due to a network error (Packagist tunnel returned 403) in this environment.
  • Running composer test could not execute because the phpunit binary was not available due to the failed dependency installation.

Codex Task

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant