31 lines
1.0 KiB
PHP
31 lines
1.0 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Tests\Feature\FormBuilder\ValidationRules;
|
|
|
|
use PHPUnit\Framework\TestCase;
|
|
|
|
/**
|
|
* WS-5b consolidation — static guard that the legacy
|
|
* `validation_rules.unique` JSON fallback has been stripped from
|
|
* `FormValueService`. The is_unique column is the single source of truth.
|
|
*
|
|
* We assert the textual absence rather than a behavioural test: uniqueness
|
|
* enforcement is heavily coupled to the FormValueObserver typed-column
|
|
* write path, submission status, etc. The cheap + high-signal check is
|
|
* "the code no longer references `$rules['unique']`".
|
|
*/
|
|
final class UniqueJsonFallbackRemovedTest extends TestCase
|
|
{
|
|
public function test_form_value_service_no_longer_reads_rules_unique_key(): void
|
|
{
|
|
$source = (string) file_get_contents(
|
|
__DIR__.'/../../../../app/Services/FormBuilder/FormValueService.php',
|
|
);
|
|
|
|
$this->assertStringNotContainsString("\$rules['unique']", $source);
|
|
$this->assertStringNotContainsString('$rules["unique"]', $source);
|
|
}
|
|
}
|