Skip to content

Increase console command coverage to >=70% for key low-coverage files #488

@armanist

Description

@armanist

Summary

Add/expand unit tests to raise low coverage in key console command classes.

This is a follow-up coverage ticket after previously completed command coverage work.

Scope

Target files and thresholds:

  • src/Console/Commands/DebugBarCommand.php from ~35% to >=70%
  • src/Console/Commands/OpenApiCommand.php from ~37% to >=70%
  • src/Console/Commands/MigrationMigrateCommand.php from ~45% to >=70%
  • src/Console/Commands/ResourceCacheClearCommand.php from ~37% to >=70%
  • src/Console/Commands/ServeCommand.php from ~15% to >=70%

Related tests (expected):

  • tests/Unit/Console/Commands/**

Goals

  1. Raise line coverage for each listed file to at least 70%.
  2. Add behavior-oriented tests (success + failure paths), not synthetic assertions.
  3. Keep tests deterministic in local and CI environments.

Test quality requirements

  • Prefer observable command behavior/output assertions over internals.
  • Cover argument/option parsing paths where relevant.
  • Cover exception/error handling branches.
  • Avoid brittle environment-dependent behavior.

Acceptance criteria

  • Coverage report shows each target file at >=70% line coverage.
  • New/updated tests pass locally and in CI.
  • Validation passes:
    • vendor/bin/phpunit --coverage-clover coverage.xml
    • composer phpstan
    • composer cs:check

Notes

  • If any branch cannot realistically reach 70%, document rationale in PR and propose a justified threshold adjustment for that file.

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions