feat(tests): add PHPUnit test suite for CLI tools and framework #238

Closed
opened 2026-05-31 14:21:14 +00:00 by jmiller · 1 comment
Owner

Problem

Test coverage is approximately 5%. Only 6 test files exist (4 unit + 2 integration) using hand-rolled assertions — no test framework.

Current State

  • tests/Enterprise/GitPlatformAdapterTest.php - manual reflection tests
  • tests/Unit/ - 3-4 basic unit tests
  • tests/test_*.php - ad-hoc integration scripts
  • Zero CLI tool tests
  • Zero plugin system tests
  • No CI test workflow

Proposal

  1. Add PHPUnit as dev dependency
  2. Create phpunit.xml.dist configuration
  3. Add smoke tests for all bin/moko commands (--help returns 0)
  4. Add unit tests for CliFramework argument parsing
  5. Add unit tests for plugin discovery and dispatch
  6. Add CI workflow to run tests on push

Priority Test Targets

  • CliFramework::parseArguments()
  • bin/moko command dispatch
  • Plugin getCommands() integration
  • Common.php utility functions
  • Version bump logic
  • Manifest parsing

Acceptance Criteria

  • PHPUnit configured in composer.json
  • phpunit.xml.dist created
  • Smoke tests for all registered commands
  • Unit tests for CliFramework core methods
  • CI workflow runs tests on push
  • composer test script added
## Problem Test coverage is approximately 5%. Only 6 test files exist (4 unit + 2 integration) using hand-rolled assertions — no test framework. ## Current State - tests/Enterprise/GitPlatformAdapterTest.php - manual reflection tests - tests/Unit/ - 3-4 basic unit tests - tests/test_*.php - ad-hoc integration scripts - Zero CLI tool tests - Zero plugin system tests - No CI test workflow ## Proposal 1. Add PHPUnit as dev dependency 2. Create phpunit.xml.dist configuration 3. Add smoke tests for all bin/moko commands (--help returns 0) 4. Add unit tests for CliFramework argument parsing 5. Add unit tests for plugin discovery and dispatch 6. Add CI workflow to run tests on push ## Priority Test Targets - CliFramework::parseArguments() - bin/moko command dispatch - Plugin getCommands() integration - Common.php utility functions - Version bump logic - Manifest parsing ## Acceptance Criteria - [ ] PHPUnit configured in composer.json - [ ] phpunit.xml.dist created - [ ] Smoke tests for all registered commands - [ ] Unit tests for CliFramework core methods - [ ] CI workflow runs tests on push - [ ] composer test script added
jmiller added the phppriority: medium labels 2026-05-31 14:21:14 +00:00
Author
Owner

Branch created: feature/238-feat-tests-add-phpunit-test-suite-for-cl

git fetch origin
git checkout feature/238-feat-tests-add-phpunit-test-suite-for-cl
Branch created: [`feature/238-feat-tests-add-phpunit-test-suite-for-cl`](https://git.mokoconsulting.tech/MokoConsulting/moko-platform/src/branch/feature/238-feat-tests-add-phpunit-test-suite-for-cl) ```bash git fetch origin git checkout feature/238-feat-tests-add-phpunit-test-suite-for-cl ```
Sign in to join this conversation.
No labels php priority: medium
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: MokoConsulting/moko-platform#238