Files
michaelschiemer/tests/Framework/MagicLinks/Commands/GenerateMagicLinkCommandTest.php
Michael Schiemer fc3d7e6357 feat(Production): Complete production deployment infrastructure
- 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.
2025-10-25 19:18:37 +02:00

61 lines
2.1 KiB
PHP

<?php
declare(strict_types=1);
use App\Framework\MagicLinks\Commands\GenerateMagicLinkCommand;
use App\Framework\MagicLinks\TokenAction;
use App\Framework\MagicLinks\TokenConfig;
use App\Framework\MagicLinks\ValueObjects\MagicLinkPayload;
describe('GenerateMagicLinkCommand', function () {
it('creates command with required parameters', function () {
$action = new TokenAction('email_verification');
$payload = MagicLinkPayload::fromArray(['email' => 'test@example.com']);
$command = new GenerateMagicLinkCommand(
action: $action,
payload: $payload
);
expect($command->action)->toBe($action);
expect($command->payload)->toBe($payload);
expect($command->config)->toBeNull();
expect($command->baseUrl)->toBeNull();
});
it('creates command with all parameters', function () {
$action = new TokenAction('email_verification');
$payload = MagicLinkPayload::fromArray(['email' => 'test@example.com']);
$config = new TokenConfig(expiryHours: 24);
$command = new GenerateMagicLinkCommand(
action: $action,
payload: $payload,
config: $config,
baseUrl: 'https://example.com',
createdByIp: '127.0.0.1',
userAgent: 'Test Agent'
);
expect($command->action)->toBe($action);
expect($command->payload)->toBe($payload);
expect($command->config)->toBe($config);
expect($command->baseUrl)->toBe('https://example.com');
expect($command->createdByIp)->toBe('127.0.0.1');
expect($command->userAgent)->toBe('Test Agent');
});
it('payload is MagicLinkPayload value object', function () {
$action = new TokenAction('test');
$payload = MagicLinkPayload::fromArray(['test' => 'value']);
$command = new GenerateMagicLinkCommand(
action: $action,
payload: $payload
);
expect($command->payload)->toBeInstanceOf(MagicLinkPayload::class);
expect($command->payload->toArray())->toBe(['test' => 'value']);
});
});