- 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.
40 lines
1.4 KiB
PHP
40 lines
1.4 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
use App\Framework\MagicLinks\Commands\ExecuteMagicLinkCommand;
|
|
use App\Framework\MagicLinks\MagicLinkToken;
|
|
use App\Framework\MagicLinks\ValueObjects\ExecutionContext;
|
|
|
|
describe('ExecuteMagicLinkCommand', function () {
|
|
it('creates command with token and context', function () {
|
|
$token = new MagicLinkToken('test-token-12345678');
|
|
$context = ExecutionContext::fromArray(['ip' => '127.0.0.1']);
|
|
|
|
$command = new ExecuteMagicLinkCommand($token, $context);
|
|
|
|
expect($command->token)->toBe($token);
|
|
expect($command->context)->toBe($context);
|
|
});
|
|
|
|
it('creates command with factory method', function () {
|
|
$token = new MagicLinkToken('test-token-12345678');
|
|
|
|
$command = ExecuteMagicLinkCommand::withToken($token);
|
|
|
|
expect($command->token)->toBe($token);
|
|
expect($command->context)->toBeInstanceOf(ExecutionContext::class);
|
|
expect($command->context->isEmpty())->toBeTrue();
|
|
});
|
|
|
|
it('context is ExecutionContext value object', function () {
|
|
$token = new MagicLinkToken('test-token-12345678');
|
|
$context = ExecutionContext::fromArray(['test' => 'value']);
|
|
|
|
$command = new ExecuteMagicLinkCommand($token, $context);
|
|
|
|
expect($command->context)->toBeInstanceOf(ExecutionContext::class);
|
|
expect($command->context->toArray())->toBe(['test' => 'value']);
|
|
});
|
|
});
|