Enhance type safety, authentication checks, and testing framework (#3701)

* Improve type safety, auth checks and PHPStan fixes (#3250)

* Improve type safety, auth checks and PHPStan fixes

* Remove @phpstan-ignore annotations

* Improve type safety, auth checks and PHPStan fixes

* Remove @phpstan-ignore annotations

* Remove redundant @phpstan-ignore comment

* Improve code robustness and reliability (#3248)

* Harden code against null/undefined values

* Update dependency lockfiles

* Sanitize ticket input and use IDs in email list

* Restructure tests and add test utilities

* Move E2E tests to `Library\E2E` namespace

* Update `php-build` action ref in workflows

* Switch tests to Pest and add test scaffolding

* Refactor E2E tests to Pest-style tests

m

Skip E2E tests when env not configured

* Refactor Unit tests and update test config

Add test datasets and refine test helpers

* Add DEBUG guard, fix API JSON decode, update tests

* Refactor tests: add types and Mockery expectations

* Adjust tests, phpstan config, and composer script

* Instantiate test APIs locally, remove beforeEach

* Refactor runtime checks, types & logging

* Apply PHP Code Styling Changes

m

* Add PHPStan ignores, test renames & small fixes

* Enable Pest tests in CI workflow

* Remove legacy tests; add new unit tests/config

* Avoid undefined index in fingerprint comparison

* Ignore properties absent in both fingerprints

* Remove public_ticket_create API method

* Add Fingerprint unit tests

* Remove em dash from fingerprint test name

* Switch to Pest; assorted bug fixes & refactors

* Prefer getDi() and guard DEBUG define

* Refactor tests: DBAL, Antispam rename, helpers

* Refactor email tests to use Doctrine entities

* Update tests, use DBAL mocks & improve Formbuilder admin

* Validate plan_id and update unit tests

* Replace error_log with DI logger and update tests

* Expect db->store in Invoice Service test

* Use DI logger instead of error_log; fix tests

* Fix typo in Hook Service test

* Fix Staff test spelling fixture

* Complete Pest test migration

* Fix Product test spelling fixtures

* Fix Product test spelling fixtures

* Run live tests with Pest and load helpers

* Migrate tests to ApiClient; remove legacy APIHelper

* Fix Email test spelling

* Remove unused PHPUnit bridge

* Organize Cypress end-to-end tests

* Document Pest test directory root

* Remove noisy Pest comments
This commit is contained in:
Adam Daley authored and GitHub committed 2026-06-02 07:43:01 +01:00
1 parent f36ee692d2
commit dd3dcbfd52
477 files changed
+45173 -56802

No files matched your search

+1 -1
View File
@@ -5,4 +5,4 @@
/src/library/FOSSBilling/GeoIP/ @BelleNottelling
/src/library/FOSSBilling/Fingerprint.php @BelleNottelling
/src/library/FOSSBilling/SentryHelper.php @BelleNottelling
/src/tests/ @BelleNottelling
/tests/ @BelleNottelling
+1 -1
View File
@@ -29,7 +29,7 @@ Reports covering any of the following topics will be rejected by the FOSSBilling
- Weak SSL/TLS/SSH algorithms or protocols.
- Attacks involving physical access to a user’s device, or involving a device or network that’s already seriously compromised (eg man-in-the-middle).
- The user attacks themselves.
- Anything in `/tests-legacy` or `tests`.
- Anything in `/tests`.
### A special note on AI tooling
-1
View File
@@ -73,5 +73,4 @@ npm:
tests/CI:
- any:
- changed-files:
- any-glob-to-any-file: ["tests-legacy/**/*"]
- any-glob-to-any-file: ["tests/**/*"]
+1 -1
View File
@@ -90,5 +90,5 @@ compose run --rm --no-deps \
app \
sh -euxc "
cd /workspace
./src/vendor/bin/phpunit --configuration phpunit-live.xml
./src/vendor/bin/pest --test-directory ../tests --configuration phpunit-live.xml
"
+3 -3
View File
@@ -61,6 +61,6 @@ jobs:
name: cypress-artifacts
if-no-files-found: ignore
path: |
tests/e2e/cypress/screenshots
tests/e2e/cypress/videos
tests/e2e/cypress/downloads
tests/E2E/Cypress/artifacts/screenshots
tests/E2E/Cypress/artifacts/videos
tests/E2E/Cypress/artifacts/downloads
+4 -4
View File
@@ -75,13 +75,13 @@ jobs:
fossbilling:test-${{ matrix.php }} \
./src/vendor/bin/phpstan analyse --configuration phpstan.neon --memory-limit=512M
- name: 'PHPUnit'
id: phpunit
- name: 'Pest'
id: pest
run: |
docker run --rm \
--env APP_ENV=test \
fossbilling:test-${{ matrix.php }} \
./src/vendor/bin/phpunit --configuration phpunit.xml.dist
./src/vendor/bin/pest --test-directory ../tests --configuration phpunit.xml.dist
- name: 'Write Job Summary'
if: always()
@@ -97,5 +97,5 @@ jobs:
| Cache mode | `${{ inputs.write-cache && 'read/write' || 'read-only' }}` |
| Docker build | `${{ inputs.write-cache && steps.build_write_cache.outcome || steps.build_read_cache.outcome }}` |
| PHPStan | `${{ steps.phpstan.outcome }}` |
| PHPUnit | `${{ steps.phpunit.outcome }}` |
| Pest | `${{ steps.pest.outcome }}` |
EOF