test: add Pest v1 security test infrastructure - #10
Open
somethingwithproof wants to merge 12 commits into
Open
Conversation
Add source-scan tests verifying security patterns (prepared statements, output escaping, auth guards, PHP 7.4 compatibility) remain in place across refactors. Tests run with Pest v1 (PHP 7.3+) and stub the Cacti framework so plugins can be tested in isolation. Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
…dabot - Throw RuntimeException when realpath/file_get_contents fails (previously silent continue hid unscanned files) - Fix Dependabot ecosystem from npm to composer - Remove committed .omc session artifacts, add .omc/ to .gitignore Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
somethingwithproof
marked this pull request as draft
April 11, 2026 00:11
Member
Author
|
Converted to draft to serialize the stack in this repo. Blocked by #8; will un-draft after that merges to avoid cross-PR merge conflicts. |
Same as hardening/comprehensive; this branch predates it, so no checks run on this PR at all. Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
ad068b5 claimed to replace silent 'continue' with a thrown RuntimeException when realpath()/file_get_contents() fail, but the diff only touched .gitignore. Neither Php74CompatibilityTest.php nor PreparedStatementConsistencyTest.php was changed, so an unscanned file still passed silently instead of failing the suite. Do the fix the commit message described. Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
Member
Author
|
Pushed two fixes:
Flagging for review rather than fixing here: `PreparedStatementConsistencyTest.php` asserts every `db_*` call in the plugin is the `_prepared` variant, but on the current develop baseline nearly every call site (functions.php, poller_wmi.php, wmi_accounts.php, etc.) is still raw. That conversion is the actual scope of #8/#9, so this test will fail hard the moment something actually runs it — right now nothing does, since the CI workflow only lints/syntax-checks and runs the poller smoke test, it never invokes Pest. |
somethingwithproof
marked this pull request as ready for review
August 29, 2026 05:54
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
… suite Pin actions/checkout and shivammathur/setup-php to commit SHAs, declare contents: read at the workflow scope, and add a step that runs the Pest suite the plugin ships. Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
Replace the disabled PHPStan step with one that installs phpstan and analyses the plugin's own config when present, so it activates once phpstan.neon lands and stays a no-op before then. Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
Cacti core now requires PHP >= 8.2, so the 8.1 integration job fails the composer platform check; Ubuntu Noble also lacks libapache2-mod-php for non-native versions without the ondrej PPA. Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
The integration CI runs php-cs-fixer as a gate on the whole plugin; this brings the pre-existing files up to the project standard. Formatting only. Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
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.
Summary
Test plan
composer install && vendor/bin/pestpasses