Files
michaelschiemer/tests/Framework/MagicLinks/Commands/ExecuteMagicLinkCommandTest.php
Michael Schiemer 5050c7d73a docs: consolidate documentation into organized structure
- Move 12 markdown files from root to docs/ subdirectories
- Organize documentation by category:
  • docs/troubleshooting/ (1 file)  - Technical troubleshooting guides
  • docs/deployment/      (4 files) - Deployment and security documentation
  • docs/guides/          (3 files) - Feature-specific guides
  • docs/planning/        (4 files) - Planning and improvement proposals

Root directory cleanup:
- Reduced from 16 to 4 markdown files in root
- Only essential project files remain:
  • CLAUDE.md (AI instructions)
  • README.md (Main project readme)
  • CLEANUP_PLAN.md (Current cleanup plan)
  • SRC_STRUCTURE_IMPROVEMENTS.md (Structure improvements)

This improves:
 Documentation discoverability
 Logical organization by purpose
 Clean root directory
 Better maintainability
2025-10-05 11:05:04 +02:00

38 lines
1.4 KiB
PHP

<?php
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']);
});
});