Wygenerowano przez równoległą analizę czterech agentów: stack, architektura, konwencje, integracje, testy, baza danych oraz wykryte problemy i dług techniczny. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1.6 KiB
1.6 KiB
Testing — rank24.pl
Test Infrastructure
No automated tests exist. There are no:
- PHPUnit configuration files (
phpunit.xml,phpunit.xml.dist) - Test directories (
tests/,test/,spec/) - Test class files (
*Test.php,*Spec.php) - CI/CD pipeline that runs tests
How Testing Is Done
All testing is manual via the web interface:
- Web UI testing — load pages in browser, exercise forms and interactions
- AJAX endpoints —
ajax-check.phpused for health checks / spot validation - Cron output —
cron.phpreturns JSON; check via browser or log inspection - PHP error logs —
error_reportingis suppressed in production; errors must be caught via server logs or temporary enabling of reporting
Debugging Aids
- OPD debug console —
$config['db']['debug']enables query logging viaopd.debug.php \S::pre()— utility for dumping variables (callsvar_dump/print_r), used inline and commented out://\S::pre($results); exit;file_put_contents('google-rank.txt', $result)— ad-hoc scraping debug log inclass.GoogleRank.php$debbbb = $data— debug variable left inclass.S.php
Adding Tests (Guidance for Future)
If automated testing is introduced:
- PHPUnit is the natural choice for PHP
- Heavy global state (
$db,$mdb,$user) makes unit testing hard without refactoring — start with integration tests against a test database - Factory classes (
factory\*) are the best seam for testing — they have clear input/output and centralize DB access - Cron methods in
class.Cron.phpreturn['status' => 'ok'|'empty', 'msg' => '...']— easily assertable