This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
This is a PHP-based mock API utility service (util.devi.tools) that provides random success/failure responses for testing purposes. It serves as a testing tool for simulating unreliable external services.
- Single-file PHP application (
public/index.php) using PHP 8.3+ - Docker-based deployment with nginx via
webdevops/php-nginx:8.3image - Deployment: GitLab CI pushes to a remote git server; tevun hooks handle container orchestration
| Method | Route | Behavior |
|---|---|---|
| GET | /api/v{n}/authorize |
Randomly returns 200 (authorized) or 403 (unauthorized) |
| POST | /api/v{n}/notify |
Randomly returns 204 (success) or 504 (timeout error) |
Using Makefile:
make setup # Create network and start containers
make network # Create reverse-proxy network (if not exists)
make up # Start containers
make down # Stop containers
make logs # View container logs
make test # Run tests inside container
make shell # Open shell in containerUsing Composer (inside container):
composer test # Run testsTests use a custom minimal framework (tests/framework.php) with no external dependencies.
# Run all tests via Docker
make test
# Run tests directly (inside container)
php tests/run.phpTest files follow the pattern tests/*_test.php.
The project uses tevun hooks for deployment automation:
setup.sh: Copies.env.stageanddocker-compose.yml.stageto production filespre-checkout.sh: Stops running containers before checkoutpost-checkout.sh: Starts containers after checkout
GitLab CI deploys master branch automatically via git push to the configured DEPLOY_REMOTE.
- All code, comments, and documentation must be written in English