- 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.
44 lines
1.4 KiB
PHP
44 lines
1.4 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
use App\Framework\Process\ValueObjects\Command;
|
|
|
|
describe('Command Value Object', function () {
|
|
it('can be created from string', function () {
|
|
$command = Command::fromString('ls -la');
|
|
|
|
expect($command->value)->toBe('ls -la')
|
|
->and($command->toString())->toBe('ls -la')
|
|
->and($command->isArray())->toBeFalse();
|
|
});
|
|
|
|
it('can be created from array', function () {
|
|
$command = Command::fromArray(['ls', '-la']);
|
|
|
|
expect($command->value)->toBe(['ls', '-la'])
|
|
->and($command->isArray())->toBeTrue();
|
|
});
|
|
|
|
it('escapes array commands when converting to string', function () {
|
|
$command = Command::fromArray(['echo', 'hello world']);
|
|
|
|
expect($command->toString())->toBe("'echo' 'hello world'");
|
|
});
|
|
|
|
it('throws exception for empty string command', function () {
|
|
Command::fromString('');
|
|
})->throws(InvalidArgumentException::class, 'Command string cannot be empty');
|
|
|
|
it('throws exception for empty array command', function () {
|
|
Command::fromArray([]);
|
|
})->throws(InvalidArgumentException::class, 'Command array cannot be empty');
|
|
|
|
it('handles special characters in array commands', function () {
|
|
$command = Command::fromArray(['echo', '$USER']);
|
|
|
|
$string = $command->toString();
|
|
expect($string)->toContain('$USER');
|
|
});
|
|
});
|