- Add comprehensive health check system with multiple endpoints - Add Prometheus metrics endpoint - Add production logging configurations (5 strategies) - Add complete deployment documentation suite: * QUICKSTART.md - 30-minute deployment guide * DEPLOYMENT_CHECKLIST.md - Printable verification checklist * DEPLOYMENT_WORKFLOW.md - Complete deployment lifecycle * PRODUCTION_DEPLOYMENT.md - Comprehensive technical reference * production-logging.md - Logging configuration guide * ANSIBLE_DEPLOYMENT.md - Infrastructure as Code automation * README.md - Navigation hub * DEPLOYMENT_SUMMARY.md - Executive summary - Add deployment scripts and automation - Add DEPLOYMENT_PLAN.md - Concrete plan for immediate deployment - Update README with production-ready features All production infrastructure is now complete and ready for deployment.
58 lines
1.4 KiB
PHP
58 lines
1.4 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
use App\Framework\Svg\ValueObjects\Geometry\Position;
|
|
|
|
test('can create position with coordinates', function () {
|
|
$position = new Position(10.5, 20.3);
|
|
|
|
expect($position->x)->toBe(10.5)
|
|
->and($position->y)->toBe(20.3);
|
|
});
|
|
|
|
test('can create zero position', function () {
|
|
$position = Position::zero();
|
|
|
|
expect($position->x)->toBe(0.0)
|
|
->and($position->y)->toBe(0.0);
|
|
});
|
|
|
|
test('can translate position', function () {
|
|
$position = new Position(10, 20);
|
|
$translated = $position->translate(5, -10);
|
|
|
|
expect($translated->x)->toBe(15.0)
|
|
->and($translated->y)->toBe(10.0);
|
|
});
|
|
|
|
test('can calculate distance between positions', function () {
|
|
$pos1 = new Position(0, 0);
|
|
$pos2 = new Position(3, 4);
|
|
|
|
$distance = $pos1->distanceTo($pos2);
|
|
|
|
expect($distance)->toBe(5.0); // 3-4-5 triangle
|
|
});
|
|
|
|
test('can scale position', function () {
|
|
$position = new Position(10, 20);
|
|
$scaled = $position->scale(2.0);
|
|
|
|
expect($scaled->x)->toBe(20.0)
|
|
->and($scaled->y)->toBe(40.0);
|
|
});
|
|
|
|
test('can check equality with tolerance', function () {
|
|
$pos1 = new Position(10.0, 20.0);
|
|
$pos2 = new Position(10.0001, 20.0001);
|
|
|
|
expect($pos1->equals($pos2))->toBeTrue();
|
|
});
|
|
|
|
test('converts to SVG string', function () {
|
|
$position = new Position(10.5, 20.3);
|
|
|
|
expect($position->toSvgString())->toBe('10.50,20.30');
|
|
});
|