- 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.
89 lines
2.1 KiB
PHP
89 lines
2.1 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
use App\Framework\QrCode\ValueObjects\Module;
|
|
|
|
test('can create dark module', function () {
|
|
$module = Module::dark();
|
|
|
|
expect($module->isDark())->toBeTrue()
|
|
->and($module->isLight())->toBeFalse();
|
|
});
|
|
|
|
test('can create light module', function () {
|
|
$module = Module::light();
|
|
|
|
expect($module->isLight())->toBeTrue()
|
|
->and($module->isDark())->toBeFalse();
|
|
});
|
|
|
|
test('can create from boolean', function () {
|
|
$dark = Module::fromBool(true);
|
|
$light = Module::fromBool(false);
|
|
|
|
expect($dark->isDark())->toBeTrue()
|
|
->and($light->isLight())->toBeTrue();
|
|
});
|
|
|
|
test('can create from bit', function () {
|
|
$dark = Module::fromBit(1);
|
|
$light = Module::fromBit(0);
|
|
|
|
expect($dark->isDark())->toBeTrue()
|
|
->and($light->isLight())->toBeTrue();
|
|
});
|
|
|
|
test('can convert to bit', function () {
|
|
$dark = Module::dark();
|
|
$light = Module::light();
|
|
|
|
expect($dark->toBit())->toBe(1)
|
|
->and($light->toBit())->toBe(0);
|
|
});
|
|
|
|
test('can invert module', function () {
|
|
$dark = Module::dark();
|
|
$light = Module::light();
|
|
|
|
$invertedDark = $dark->invert();
|
|
$invertedLight = $light->invert();
|
|
|
|
expect($invertedDark->isLight())->toBeTrue()
|
|
->and($invertedLight->isDark())->toBeTrue();
|
|
});
|
|
|
|
test('invert returns new instance', function () {
|
|
$original = Module::dark();
|
|
$inverted = $original->invert();
|
|
|
|
// Original unchanged
|
|
expect($original->isDark())->toBeTrue()
|
|
->and($inverted->isLight())->toBeTrue();
|
|
});
|
|
|
|
test('can convert to string', function () {
|
|
$dark = Module::dark();
|
|
$light = Module::light();
|
|
|
|
expect($dark->toString())->toBe('█')
|
|
->and($light->toString())->toBe('░');
|
|
});
|
|
|
|
test('dark and light are opposites', function () {
|
|
$dark = Module::dark();
|
|
$light = Module::light();
|
|
|
|
expect($dark->isDark())->not->toBe($light->isDark())
|
|
->and($dark->isLight())->not->toBe($light->isLight());
|
|
});
|
|
|
|
test('module is immutable', function () {
|
|
$module = Module::dark();
|
|
|
|
// Attempting to invert doesn't change original
|
|
$module->invert();
|
|
|
|
expect($module->isDark())->toBeTrue();
|
|
});
|