Skip to content

Introduce PHPUnit integration and initial test suite#6

Merged
dieselxxx merged 5 commits into
developfrom
feature/phpunit-integration-and-initial-tests
Jun 24, 2026
Merged

Introduce PHPUnit integration and initial test suite#6
dieselxxx merged 5 commits into
developfrom
feature/phpunit-integration-and-initial-tests

Conversation

@dieselxxx

@dieselxxx dieselxxx commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

💢 Feature / Enhancement Pull Request

Related Issue

Description

  • This PR introduces PHPUnit testing infrastructure into the FireHub Core-Standard repository, along with the initial set of Core validation tests.
  • It is needed to establish a formal, automated testing layer for Core contracts and ensure that foundational architectural rules are continuously validated during development and CI execution.
  • This improves the FireHub ecosystem by:
    • Introducing a reliable verification layer for Core behavior
    • Enforcing deterministic validation of architectural contracts
    • Reducing regression risk across Core, Runtime Foundation, and downstream packages
    • Establishing testing as a first-class governance mechanism within FireHub
  • Context / design notes:
    • PHPUnit is integrated via Composer-based tooling (require-dev)
    • Testing is isolated from the FireHub runtime autoloader (uses Composer autoload instead)
    • Initial tests target Core-level contracts to validate structural integrity and expected behavior
    • This layer is intended to grow into a full ecosystem-wide validation suite across all FireHub editions

Feature Overview

Functional Changes

  • Introduced PHPUnit integration into Core-Standard development workflow via firehub/testing dependency
  • Added initial testing infrastructure and configuration support (phpunit.xml, bootstrap structure)
  • Established foundation for executing unit tests within the Core-Standard repository
  • Introduced initial test suite structure for Core domain validation

API / Behavior Changes

  • Public API changes:

    • No runtime API changes introduced
    • Testing layer integration via FireHub\Testing\FireHubTestCase
  • Internal behavior changes:

    • Core-Standard now depends on firehub/testing for test execution
    • PHPUnit is no longer directly referenced inside Core-Standard
    • Test execution flow is delegated to FireHub Testing layer abstraction

Dependencies

  • Added / Updated / Removed:
    • the-firehub-project/testing (dev dependency)
    • phpunit/phpunit (transitive dependency via testing package)
    • PHPUnit integration configuration introduced

Compatibility

  • Backward compatible:
    • Yes
    • No (explain below)

Testing

Validation

  • Feature implemented according to requirements
  • Manual testing completed
  • Edge cases verified

Automated Tests

  • Unit tests added / updated
  • Integration tests added / updated
  • Test coverage updated
  • All CI checks pass

Documentation

  • Changelog updated
  • Documentation updated
  • Usage examples added / updated
  • Migration notes are added (if applicable)

Checklist

  • Issue linked
  • Feature clearly described
  • No unrelated changes are included
  • Code self-reviewed
  • Follows FireHub coding standards

Risks / Impact

  • Risk level:
    • None
    • Low
    • Medium
    • High

Potential Impacts

  • Side effects:

    • Introduces testing dependency into development workflow (no runtime impact)
  • Affected modules:

    • Core / Runtime / Adapter / Capability (indirect, via shared testing layer)

QA Focus Areas

  • Verify PHPUnit executes correctly via vendor/bin/phpunit
  • Verify FireHubTestCase inheritance works across Core tests
  • Validate autoload-dev and test directory mapping
  • Ensure no runtime coupling between Core and PHPUnit

Notes

Technical Notes

  • PHPUnit is abstracted behind firehub/testing to avoid direct Core dependency
  • Test bootstrap separates runtime configuration from Core logic
  • Initial test suite serves as foundation for future Core, Integration, and Architecture test layers

QA / Reviewer Notes

  • Focus on correctness of test infrastructure rather than test coverage depth
  • Ensure separation between Core runtime code and testing infrastructure is preserved

Revised the `README.md` to reflect the introduction of PHPUnit testing infrastructure into the `feature/phpunit-integration-and-initial-tests` branch. Changes include updated badge links, branch-specific information, and details on core testing objectives, architectural goals, and initial test coverage. Establishes a clear purpose and documentation for the new testing layer within the FireHub ecosystem.
@dieselxxx dieselxxx added the type: Feature Introduces new functionality or capabilities. label Jun 23, 2026
@dieselxxx dieselxxx moved this from Backlog to Draft in 📌 Core Development: v0 → v1 Jun 23, 2026
@dieselxxx dieselxxx moved this from Todo to Done in 🚩 Triage Jun 23, 2026
@dieselxxx dieselxxx linked an issue Jun 23, 2026 that may be closed by this pull request
1 task
Reordered and standardized docblock annotations in the `equals` and `sameAs` methods. Adjusted the position of `@uses` and `@since` annotations to improve readability and align with documentation conventions. No functional changes were introduced.
Updated the include path in `phpstan.neon` to align with correct casing (`Config` instead of `config`). This ensures compatibility with case-sensitive file systems and prevents potential runtime issues during static analysis.
Introduced a `phpunit.xml` configuration file to establish a testing framework for the repository. Updated `.gitattributes` to exclude the PHPUnit configuration file from export. Enhanced `composer.json` by adding `the-firehub-project/testing` as a development dependency and configuring `autoload` and `autoload-dev` sections to map source and test namespaces. These changes lay the groundwork for unit testing and streamlined development workflows.
Implemented `ValueObjectTest` to verify the behavior of the `ValueObject` base class, covering the `equals` and `sameAs` methods. Introduced `DummyStringVO` and `DummyIntVO` stubs to facilitate testing. Added a reusable PHPUnit GitHub Actions workflow for automated test execution on pull requests. These changes enhance code reliability and ensure foundational test coverage for value objects.
@dieselxxx dieselxxx moved this from Draft to Done in 📌 Core Development: v0 → v1 Jun 24, 2026
@dieselxxx dieselxxx marked this pull request as ready for review June 24, 2026 11:34
@dieselxxx dieselxxx requested review from a team as code owners June 24, 2026 11:34
@dieselxxx dieselxxx merged commit d31c041 into develop Jun 24, 2026
6 checks passed
@dieselxxx dieselxxx deleted the feature/phpunit-integration-and-initial-tests branch June 24, 2026 11:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: Feature Introduces new functionality or capabilities.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Introduce PHPUnit testing infrastructure

2 participants