test: extract test cases from #20 into current Pest framework - #27
Merged
Merged
Conversation
- SetupStructureTest: parse INFO directly and assert name/version keys via toHaveKey() instead of regex-matching the raw source, per PR #20. - Php74CompatibilityTest: add PHP 8.0-construct checks (str_contains, str_starts_with, str_ends_with, nullsafe operator) for the entry-point files (cli.php, config.php, controllers/cacti.php, controllers/hosts.php, controllers/services.php, setup.php) covered by PR #20, with fail-fast error handling on unreadable files. composer.json/composer.lock/phpunit.xml/tests/bootstrap.php from PR #20 are intentionally not carried over since this repo already has an equivalent, newer Pest test framework (tests/bootstrap-unit.php, tests/TestCase.php, root phpunit.xml) merged via #26.
2 tasks
There was a problem hiding this comment.
🟡 Changes recommended
The setup test no longer verifies that setup.php loads metadata from INFO.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
Adapts security tests from #20 to the existing Pest framework from #26.
Changes:
- Parses
INFOdirectly for metadata assertions. - Adds PHP 8 compatibility checks for entry-point files.
File summaries
| File | Description |
|---|---|
tests/Security/SetupStructureTest.php |
Validates parsed plugin metadata. |
tests/Security/Php74CompatibilityTest.php |
Scans entry points for PHP 8-only syntax. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Address Copilot review feedback on #27 - toHaveKey() alone would still pass if setup.php stopped loading INFO via parse_ini_file(), so keep the source-level check alongside the parsed-metadata assertion.
xmacan
approved these changes
Sep 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Extracts the meaningful test cases from #20 (
test/add-security-test-infrastructure) and adapts them to run inside the Pest test framework already merged via #26 (tests/bootstrap-unit.php,tests/TestCase.php, rootphpunit.xml), rather than the standalone composer/bootstrap.php scaffold #20 introduced.Carried over:
tests/Security/SetupStructureTest.php: replaced the regex-based INFO name/version checks with test: add Pest v1 security test infrastructure #20's cleaner approach — parse theINFOfile directly and assert on the resulting array withtoHaveKey().tests/Security/Php74CompatibilityTest.php: added test: add Pest v1 security test infrastructure #20's PHP 8.0-construct checks (str_contains,str_starts_with,str_ends_with, nullsafe operator) for its entry-point file list (cli.php,config.php,controllers/cacti.php,controllers/hosts.php,controllers/services.php,setup.php), with fail-fast error handling on unreadable files, as additional test cases alongside the existing coverage.Intentionally not carried over (superseded by #26's framework already on
develop):composer.json/composer.lock(plugins don't ship a composer.json)phpunit.xml,tests/Pest.php,tests/bootstrap.php.gitignoreaddition (not a test case)Closes #20.