- 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.
106 lines
3.7 KiB
PHP
106 lines
3.7 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
use App\Domain\PreSave\ValueObjects\RegistrationStatus;
|
|
|
|
describe('RegistrationStatus', function () {
|
|
describe('processing checks', function () {
|
|
it('identifies PENDING should be processed', function () {
|
|
expect(RegistrationStatus::PENDING->shouldProcess())->toBeTrue();
|
|
});
|
|
|
|
it('identifies COMPLETED should not be processed', function () {
|
|
expect(RegistrationStatus::COMPLETED->shouldProcess())->toBeFalse();
|
|
});
|
|
|
|
it('identifies FAILED should not be processed', function () {
|
|
expect(RegistrationStatus::FAILED->shouldProcess())->toBeFalse();
|
|
});
|
|
|
|
it('identifies REVOKED should not be processed', function () {
|
|
expect(RegistrationStatus::REVOKED->shouldProcess())->toBeFalse();
|
|
});
|
|
});
|
|
|
|
describe('final status checks', function () {
|
|
it('identifies COMPLETED as final', function () {
|
|
expect(RegistrationStatus::COMPLETED->isFinal())->toBeTrue();
|
|
});
|
|
|
|
it('identifies REVOKED as final', function () {
|
|
expect(RegistrationStatus::REVOKED->isFinal())->toBeTrue();
|
|
});
|
|
|
|
it('identifies PENDING as not final', function () {
|
|
expect(RegistrationStatus::PENDING->isFinal())->toBeFalse();
|
|
});
|
|
|
|
it('identifies FAILED as not final', function () {
|
|
expect(RegistrationStatus::FAILED->isFinal())->toBeFalse();
|
|
});
|
|
});
|
|
|
|
describe('retry capability', function () {
|
|
it('allows retry for FAILED status', function () {
|
|
expect(RegistrationStatus::FAILED->canRetry())->toBeTrue();
|
|
});
|
|
|
|
it('disallows retry for PENDING status', function () {
|
|
expect(RegistrationStatus::PENDING->canRetry())->toBeFalse();
|
|
});
|
|
|
|
it('disallows retry for COMPLETED status', function () {
|
|
expect(RegistrationStatus::COMPLETED->canRetry())->toBeFalse();
|
|
});
|
|
|
|
it('disallows retry for REVOKED status', function () {
|
|
expect(RegistrationStatus::REVOKED->canRetry())->toBeFalse();
|
|
});
|
|
});
|
|
|
|
describe('badge colors', function () {
|
|
it('returns yellow for PENDING', function () {
|
|
$color = RegistrationStatus::PENDING->getBadgeColor();
|
|
expect(str_contains($color, 'yellow'))->toBeTrue();
|
|
});
|
|
|
|
it('returns green for COMPLETED', function () {
|
|
$color = RegistrationStatus::COMPLETED->getBadgeColor();
|
|
expect(str_contains($color, 'green'))->toBeTrue();
|
|
});
|
|
|
|
it('returns red for FAILED', function () {
|
|
$color = RegistrationStatus::FAILED->getBadgeColor();
|
|
expect(str_contains($color, 'red'))->toBeTrue();
|
|
});
|
|
|
|
it('returns gray for REVOKED', function () {
|
|
$color = RegistrationStatus::REVOKED->getBadgeColor();
|
|
expect(str_contains($color, 'gray'))->toBeTrue();
|
|
});
|
|
});
|
|
|
|
describe('display labels', function () {
|
|
it('returns correct label for PENDING', function () {
|
|
$label = RegistrationStatus::PENDING->getLabel();
|
|
expect(str_contains($label, 'Pending'))->toBeTrue();
|
|
});
|
|
|
|
it('returns correct label for COMPLETED', function () {
|
|
$label = RegistrationStatus::COMPLETED->getLabel();
|
|
expect(str_contains($label, 'Completed'))->toBeTrue();
|
|
});
|
|
|
|
it('returns correct label for FAILED', function () {
|
|
$label = RegistrationStatus::FAILED->getLabel();
|
|
expect(str_contains($label, 'Failed'))->toBeTrue();
|
|
});
|
|
|
|
it('returns correct label for REVOKED', function () {
|
|
$label = RegistrationStatus::REVOKED->getLabel();
|
|
expect(str_contains($label, 'Revoked'))->toBeTrue();
|
|
});
|
|
});
|
|
});
|