feat: add complete test suite for v1 endpoints#1093
Merged
Conversation
- Unit tests: solrEscape, auth, validation, query building (plain PHP) - Integration tests: mock Solr server, HTTP tests for all 3 endpoints - E2E smoke tests: api.peviitor.ro (triggered after deploy) - HTML report generator with badge + color-coded results - GitHub Actions: test-pr.yml (PR), test-deploy.yml (post-deploy) - FTP deploy of test report to api.peviitor.ro/tests/ - Badge link in documentation page
ale23yfm
approved these changes
Jun 20, 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.
Changes
New:
tests/— complete test infrastructureUnit Tests (plain PHP, no framework):
TestSolrEscape.php— escape caractere speciale SolrTestAuth.php—md5(company + cif),hash_equals()TestValidation.php— input validation, length limits, confirmationTestQueryBuild.php— construcție query-uri AND/OR cu escapeIntegration Tests (mock Solr + PHP built-in server):
TestRandom.php—GET /v1/random/(200, 405, field types)TestEmpty.php—DELETE /v1/empty/(200, 401, 405)TestCleanjobs.php—DELETE /v1/cleanjobs/(200, 400, 401, 404, 405, brand lookup)E2E (after deploy, on api.peviitor.ro):
TestSmoke.php— smoke testing on production endpointsHTML Report
tests/generate-report.phpapi.peviitor.ro/tests/report.htmlGitHub Actions
test-pr.yml— rulează unit + integration pe PRtest-deploy.yml— rulează după deploy (toate 3 + FTP report)index.php
🧪 Test Reportîn header, link spre/tests/report.htmlCloses
Closes #1092