Skip to content

Issue-215: Add tests to ensure no future regressions in configure.php - #216

Open
mogmarsh wants to merge 3 commits into
productionfrom
feature/issue-215/tests-for-configure-php-regressions
Open

mogmarsh wants to merge 3 commits into
productionfrom
feature/issue-215/tests-for-configure-php-regressions

Conversation

@mogmarsh

@mogmarsh mogmarsh commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes #215

Description

This PR introduces a comprehensive test suite to ensure the ongoing reliability of the configure.php script. It covers all functions within configure.php so that any future changes to the codebase will not inadvertently cause regressions in the setup process.

Key enhancements include:

  • Automated Testing:

    • A new PHPUnit test suite (tests/ConfigureTest.php) simulates end-to-end runs of configure.php using scripted answers. It verifies the correct file structure and content after configuration.
    • The test suite mocks external dependencies where necessary and ensures the script functions as intended in a clean skeleton context.
    • The GitHub Actions workflow now includes a dedicated step to run these tests (composer test:configure) immediately after installation and prior to running the real configure.php script. This ensures the skeleton's configuration process is validated before any modifications occur.
  • Script and Tooling Updates:

    • The composer.json file has been updated so that the test script now runs the configure tests alongside existing checks like phpcs, phpstan, and phpunit.
    • A new test:configure script has been added for focused execution of the configure script tests.
  • Documentation Improvements:

    • The CONTRIBUTING.md now includes a section explaining how to run and maintain the configure script’s test suite, with details on test setup and expected assertions.
  • Cleanup Mechanism:

    • configure.php has been refactored to remove test infrastructure (such as ConfigureTest.php) from the initialized project, ensuring these files remain only in the skeleton/template.

Use Case

With these changes, users and maintainers can confidently update the project, knowing that any unintended changes to the configuration process will be caught by automated tests. This safeguards the setup experience for all users.

Testing Instructions

  • Run the new tests (composer test or composer test:configure) to verify that all functions in configure.php are covered and functioning correctly.
  • Make small, intentional changes to configure.php and confirm that the test suite detects any regressions or failures.
  • Check the GitHub Actions workflow for successful execution of the new configure script test step.

Additional Notes

No additional changes outside the scope described above. The added test infrastructure exists only in the skeleton and is removed from initialized projects to avoid unnecessary files.

@mogmarsh mogmarsh added php Requires understanding PHP enhancement New feature or request labels Sep 9, 2026
@mogmarsh
mogmarsh marked this pull request as ready for review September 9, 2026 21:39
@mogmarsh
mogmarsh requested a review from a team as a code owner September 9, 2026 21:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request php Requires understanding PHP

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add tests to ensure no future regressions in configure.php

1 participant