2026-04-18 12:57:20 +02:00
|
|
|
|
# Mine-Seeker Game Documentation
|
|
|
|
|
|
|
2026-04-21 17:58:05 +02:00
|
|
|
|
This directory contains comprehensive documentation about the Mine-Seeker game mechanics, testing, and deployment.
|
2026-04-18 12:57:20 +02:00
|
|
|
|
|
|
|
|
|
|
## Game Mechanics
|
|
|
|
|
|
|
|
|
|
|
|
### [Bonus Points System](./game-mechanics/BONUS_POINTS_SYSTEM.md)
|
|
|
|
|
|
Complete reference for the bonus points system including:
|
|
|
|
|
|
- All 6 bonus point types (Blind Hit, Chain Combo, Edge Mine, Endgame Mine, Safe Cell Bonus, Biggest Reveal)
|
|
|
|
|
|
- Calculation rules and examples
|
|
|
|
|
|
- Bonus statistics tracking
|
|
|
|
|
|
- Player name formatting in dialogs
|
|
|
|
|
|
- Database schema
|
|
|
|
|
|
- Implementation notes
|
|
|
|
|
|
- Testing checklist
|
|
|
|
|
|
|
|
|
|
|
|
**Recommended for**: Developers working on bonus system, AI assistants implementing or debugging bonus features, understanding game scoring mechanics.
|
|
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
2026-04-21 17:56:04 +02:00
|
|
|
|
## Testing
|
|
|
|
|
|
|
|
|
|
|
|
### [Testing Guide](./testing/TESTING.md)
|
|
|
|
|
|
Complete testing setup and best practices including:
|
|
|
|
|
|
- Test environment configuration
|
|
|
|
|
|
- Database isolation with DAMA Doctrine Test Bundle
|
|
|
|
|
|
- Test database setup (`mineseeker_test`)
|
2026-04-21 17:58:05 +02:00
|
|
|
|
- Modern PHPUnit attributes (`#[Test]`, `#[TestDox]`)
|
2026-04-21 17:56:04 +02:00
|
|
|
|
- Writing effective tests
|
|
|
|
|
|
- Running tests (all, specific, with coverage)
|
|
|
|
|
|
- Best practices (AAA pattern, factories, type hints)
|
|
|
|
|
|
- CI/CD integration examples
|
|
|
|
|
|
- Troubleshooting guide
|
|
|
|
|
|
|
|
|
|
|
|
**Recommended for**: All developers, understanding test infrastructure, writing new tests, debugging test failures.
|
|
|
|
|
|
|
|
|
|
|
|
### [Factory Documentation](./testing/FACTORIES.md)
|
|
|
|
|
|
Detailed API reference for Zenstruck Foundry factories:
|
|
|
|
|
|
- All available factories (User, Gamer, PlayedGame, Step, Grid, etc.)
|
|
|
|
|
|
- Factory usage examples
|
|
|
|
|
|
- Creating related entities
|
|
|
|
|
|
- Repository access
|
|
|
|
|
|
- Database isolation explanation
|
|
|
|
|
|
- Best practices and patterns
|
|
|
|
|
|
|
|
|
|
|
|
**Recommended for**: Writing tests with test data, understanding factory patterns, creating complex test scenarios.
|
|
|
|
|
|
|
2026-04-21 17:58:05 +02:00
|
|
|
|
### [Quick Reference](./testing/QUICK_REFERENCE.md)
|
|
|
|
|
|
Quick command reference for testing:
|
|
|
|
|
|
- Common test commands
|
|
|
|
|
|
- Factory usage cheat sheet
|
|
|
|
|
|
- Troubleshooting tips
|
|
|
|
|
|
|
|
|
|
|
|
**Recommended for**: Quick lookups during development.
|
|
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
|
|
## CI/CD & Deployment
|
|
|
|
|
|
|
|
|
|
|
|
### [CI/CD Integration Guide](./CI_CD.md)
|
|
|
|
|
|
Comprehensive guide for continuous integration and deployment:
|
|
|
|
|
|
- Gitea Actions workflows (CI and CD pipelines)
|
|
|
|
|
|
- Automated testing on every push/PR
|
|
|
|
|
|
- Deployment process with pre-deployment testing
|
|
|
|
|
|
- Configuration requirements (secrets, variables)
|
|
|
|
|
|
- Rollback procedures
|
|
|
|
|
|
- Security considerations
|
|
|
|
|
|
- Performance optimization
|
|
|
|
|
|
- Monitoring and notifications
|
|
|
|
|
|
- Troubleshooting deployment issues
|
|
|
|
|
|
|
|
|
|
|
|
**Recommended for**: Understanding deployment pipeline, setting up CI/CD, debugging deployment failures, production operations.
|
|
|
|
|
|
|
|
|
|
|
|
### [CI/CD Quick Reference](./testing/CI_CD_QUICK_REFERENCE.md)
|
|
|
|
|
|
Quick reference for CI/CD operations:
|
|
|
|
|
|
- Common commands (testing, deployment, rollback)
|
|
|
|
|
|
- Workflow diagrams (CI and CD pipelines)
|
|
|
|
|
|
- Status badges for README
|
|
|
|
|
|
- Common issues and solutions
|
|
|
|
|
|
- Environment variables
|
|
|
|
|
|
- Monitoring links
|
|
|
|
|
|
|
|
|
|
|
|
**Recommended for**: Quick deployments, troubleshooting, day-to-day operations.
|
|
|
|
|
|
|
2026-04-21 17:56:04 +02:00
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
|
|
## Technical Documentation
|
|
|
|
|
|
|
|
|
|
|
|
### [Fonts](./FONTS.md)
|
|
|
|
|
|
TrueType fonts used for server-side image generation:
|
|
|
|
|
|
- Font file locations
|
|
|
|
|
|
- Usage in battle card generation
|
|
|
|
|
|
- Web vs. server-side font formats
|
|
|
|
|
|
|
|
|
|
|
|
**Recommended for**: Working on OG image generation, understanding font rendering.
|
|
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
2026-04-18 12:57:20 +02:00
|
|
|
|
## Quick Reference
|
|
|
|
|
|
|
2026-04-21 17:58:05 +02:00
|
|
|
|
### Test Suite Overview
|
|
|
|
|
|
| Metric | Value |
|
|
|
|
|
|
|--------|-------|
|
|
|
|
|
|
| Total Tests | 71 |
|
|
|
|
|
|
| Total Assertions | 227 |
|
|
|
|
|
|
| Execution Time | ~6-8 seconds |
|
|
|
|
|
|
| Coverage | Controller, DTO, Entity, Service, Integration |
|
|
|
|
|
|
|
2026-04-18 12:57:20 +02:00
|
|
|
|
### Bonus Points at a Glance
|
|
|
|
|
|
| Bonus Type | Points | Condition |
|
|
|
|
|
|
|-----------|--------|-----------|
|
|
|
|
|
|
| Blind Hit | +2 | Mine with no revealed numbered neighbors |
|
|
|
|
|
|
| Edge Mine | +1 | Mine on board boundary (row/col 0 or 15) |
|
|
|
|
|
|
| Endgame Mine | +3 | Mine clicked when ≤10 mines remain |
|
|
|
|
|
|
| Safe Cell | +0.5 each | ≥2 safe cells revealed (min requirement) |
|
|
|
|
|
|
| Chain Combo | Tracked | Consecutive mine clicks (no safe clicks) |
|
|
|
|
|
|
| Biggest Reveal | Tracked | Largest number of safe cells revealed |
|
|
|
|
|
|
|
2026-04-21 17:56:04 +02:00
|
|
|
|
### Available Test Factories
|
|
|
|
|
|
| Factory | Entity | Purpose |
|
|
|
|
|
|
|---------|--------|---------|
|
|
|
|
|
|
| `UserFactory` | `User` | Registered users |
|
|
|
|
|
|
| `GamerFactory` | `Gamer` | Anonymous/guest players |
|
|
|
|
|
|
| `PlayedGameFactory` | `PlayedGame` | Game records |
|
|
|
|
|
|
| `StepFactory` | `Step` | Game moves |
|
|
|
|
|
|
| `GridFactory` | `Grid` | Game grids (16×16) |
|
|
|
|
|
|
| `GridRowFactory` | `GridRow` | Grid rows |
|
|
|
|
|
|
| `WebAuthnCredentialFactory` | `WebAuthnCredential` | Passkey credentials |
|
|
|
|
|
|
| `ContactMessageFactory` | `ContactMessage` | Contact messages |
|
|
|
|
|
|
|
|
|
|
|
|
### Running Tests
|
|
|
|
|
|
```bash
|
2026-04-21 17:58:05 +02:00
|
|
|
|
# Setup (first time only)
|
2026-04-21 17:56:04 +02:00
|
|
|
|
make test-db-setup
|
|
|
|
|
|
|
2026-04-21 17:58:05 +02:00
|
|
|
|
# Run all tests
|
|
|
|
|
|
make test
|
|
|
|
|
|
|
|
|
|
|
|
# Run with documentation output
|
|
|
|
|
|
vendor/bin/phpunit --testdox
|
2026-04-21 17:56:04 +02:00
|
|
|
|
|
|
|
|
|
|
# Specific file
|
|
|
|
|
|
vendor/bin/phpunit tests/Controller/ProfileControllerTest.php
|
|
|
|
|
|
|
|
|
|
|
|
# With coverage (requires Xdebug/PCOV)
|
2026-04-21 17:58:05 +02:00
|
|
|
|
XDEBUG_MODE=coverage vendor/bin/phpunit --coverage-html var/coverage
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
### CI/CD Commands
|
|
|
|
|
|
```bash
|
|
|
|
|
|
# Deploy to production
|
|
|
|
|
|
git tag -a v1.2.3 -m "Release version 1.2.3"
|
|
|
|
|
|
git push origin v1.2.3
|
|
|
|
|
|
|
|
|
|
|
|
# View CI/CD runs
|
|
|
|
|
|
# https://source.splendidbear.org/SplendidBear-Websites/Mine/actions
|
2026-04-21 17:56:04 +02:00
|
|
|
|
|
2026-04-21 17:58:05 +02:00
|
|
|
|
# Rollback deployment
|
|
|
|
|
|
git push origin v1.2.2 # Deploy previous version
|
2026-04-21 17:56:04 +02:00
|
|
|
|
```
|
2026-04-18 12:57:20 +02:00
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
|
|
## Files Using This Information
|
2026-04-21 17:56:04 +02:00
|
|
|
|
|
|
|
|
|
|
### Game Mechanics
|
2026-04-18 12:57:20 +02:00
|
|
|
|
- Backend: `/src/Util/TopicManager.php`
|
|
|
|
|
|
- Frontend: `/assets/js/mine-seeker/contexts/GameProvider.jsx`
|
|
|
|
|
|
- UI: `/assets/js/mine-seeker/components/BonusStatsDialog.jsx`
|
|
|
|
|
|
- Constants: `/assets/js/mine-seeker/utils/constants.jsx`
|
|
|
|
|
|
|
2026-04-21 17:56:04 +02:00
|
|
|
|
### Testing
|
|
|
|
|
|
- Test Base Class: `/tests/WebTestCase.php`
|
|
|
|
|
|
- Factories: `/tests/Factory/`
|
|
|
|
|
|
- Example Tests: `/tests/Integration/FactoryExampleTest.php`
|
|
|
|
|
|
- PHPUnit Config: `/phpunit.dist.xml`
|
|
|
|
|
|
- Bundle Config: `/config/bundles.php`
|
|
|
|
|
|
|
2026-04-21 17:58:05 +02:00
|
|
|
|
### CI/CD
|
|
|
|
|
|
- CI Workflow: `/.gitea/workflows/ci.yml`
|
|
|
|
|
|
- CD Workflow: `/.gitea/workflows/deploy.yml`
|
|
|
|
|
|
- Dockerfile: `/Dockerfile`
|
|
|
|
|
|
- Docker Compose: `/compose.yaml`
|
|
|
|
|
|
|
2026-04-21 17:56:04 +02:00
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
|
|
## Additional Resources
|
2026-04-18 12:57:20 +02:00
|
|
|
|
|
2026-04-21 17:56:04 +02:00
|
|
|
|
- **[Main README](../README.md)** - Project overview, installation, deployment
|
|
|
|
|
|
- **[AI Agent Guidelines](../AGENTS.md)** - Comprehensive guide for AI coding agents
|
|
|
|
|
|
- **[Zenstruck Foundry](https://symfony.com/bundles/ZenstruckFoundryBundle/current/index.html)** - Official Foundry documentation
|
|
|
|
|
|
- **[PHPUnit](https://phpunit.de/)** - PHPUnit documentation
|
|
|
|
|
|
- **[Symfony Testing](https://symfony.com/doc/current/testing.html)** - Symfony testing guide
|
2026-04-21 17:58:05 +02:00
|
|
|
|
- **[Gitea Actions](https://docs.gitea.com/usage/actions/overview)** - Gitea Actions documentation
|
|
|
|
|
|
- **[Docker Compose](https://docs.docker.com/compose/)** - Docker Compose reference
|