Skip to content

test: add Pest v1 security test infrastructure#55

Merged
TheWitness merged 4 commits into
Cacti:developfrom
somethingwithproof:test/security-test-infrastructure
Jul 24, 2026
Merged

test: add Pest v1 security test infrastructure#55
TheWitness merged 4 commits into
Cacti:developfrom
somethingwithproof:test/security-test-infrastructure

Conversation

@somethingwithproof

Copy link
Copy Markdown
Contributor

Separates the Pest security test infrastructure into its own PR as requested.

Copilot AI review requested due to automatic review settings April 11, 2026 23:02

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds initial Pest v1-based “security” test scaffolding for the Cacti audit plugin, aiming to catch structural regressions and certain unsafe patterns via lightweight static checks.

Changes:

  • Added a Pest bootstrap that stubs key Cacti framework functions/constants for isolated test execution.
  • Added security-oriented Pest tests for setup.php structure, prepared-statement usage, and PHP 7.4 syntax compatibility.
  • Added tests/Pest.php to load the bootstrap.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
tests/bootstrap.php Provides stubbed Cacti functions/constants to allow tests to run without a full Cacti install.
tests/Pest.php Pest entrypoint that loads the test bootstrap.
tests/Security/SetupStructureTest.php Verifies setup.php contains required plugin lifecycle functions and version keys.
tests/Security/PreparedStatementConsistencyTest.php Attempts to enforce exclusive usage of prepared DB helpers in core plugin files.
tests/Security/Php74CompatibilityTest.php Scans for common PHP 8.0+ syntax/features in core plugin files.

Comment thread tests/bootstrap.php
Comment thread tests/bootstrap.php
Comment thread tests/Security/SetupStructureTest.php
Comment thread tests/Security/PreparedStatementConsistencyTest.php Outdated
Comment thread tests/Security/PreparedStatementConsistencyTest.php Outdated
Comment thread tests/Security/Php74CompatibilityTest.php Outdated
@somethingwithproof
somethingwithproof force-pushed the test/security-test-infrastructure branch from 9ea4ea3 to 4575e4d Compare July 14, 2026 10:46
@TheWitness
TheWitness merged commit 5a3f525 into Cacti:develop Jul 24, 2026
1 check passed
@somethingwithproof
somethingwithproof deleted the test/security-test-infrastructure branch July 24, 2026 20:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants