mirror of
https://github.com/Cacti/plugin_monitor.git
synced 2026-10-24 12:07:01 +09:00
Cherry-picked from Cacti/plugin_monitor#229 (somethingwithproof:hardening/testing-and-workflows) and adapted to this repo's existing Pest setup: - .github/workflows/codeql.yml: added as-is (JS/TS CodeQL scanning). - tests/Integration/OutputEscapingTest.php: added as-is, references tests/Unit instead of tests/unit in its docblock. - tests/Unit/DbFunctionsTest.php: added, placed under tests/Unit (PascalCase) instead of tests/unit to match this repo's layout. - tests/bootstrap-unit.php: get_request_var()/get_nfilter_request_var()/get_filter_request_var()/set_request_var() now read/write a stubbed \['__test_request'] store, and a new test_set_request() helper lets tests control request vars, mirroring #229's tests/bootstrap.php. - tests/Pest.php: added a beforeEach() hook resetting __test_db_calls and the request var store between tests.
20 lines
755 B
PHP
20 lines
755 B
PHP
<?php
|
|
/*
|
|
+-------------------------------------------------------------------------+
|
|
| Copyright (C) 2004-2026 The Cacti Group |
|
|
+-------------------------------------------------------------------------+
|
|
| Cacti: The Complete RRDtool-based Graphing Solution |
|
|
+-------------------------------------------------------------------------+
|
|
*/
|
|
|
|
/*
|
|
* Pest configuration file. The bootstrap is loaded via phpunit.xml's
|
|
* bootstrap attribute (tests/bootstrap-unit.php), which requires Cacti's
|
|
* own Composer-managed vendor tree checked out by the CI workflow.
|
|
*/
|
|
|
|
uses()->beforeEach(function () {
|
|
$GLOBALS['__test_db_calls'] = array();
|
|
test_set_request(array());
|
|
})->in(__DIR__);
|