File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
tests/Unit/Http/Controllers Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -52,6 +52,20 @@ public function testEditReturnsSettingsAndCertificateStateIncludingLocalCertific
5252 self ::assertTrue ($ response ->data ['certificateState ' ]['has_saved_settings ' ] ?? false );
5353 }
5454
55+ public function testEditReturnsEmptyCertificateStateWhenNoSavedCnpjExists (): void
56+ {
57+ ControllerIsolationState::reset ();
58+
59+ $ response = (new SettingsController ())->edit ();
60+
61+ self ::assertSame ('nfse::settings.edit ' , $ response ->name );
62+ self ::assertSame ([], $ response ->data ['settings ' ] ?? []);
63+ self ::assertSame ('' , $ response ->data ['certificateState ' ]['cnpj ' ] ?? null );
64+ self ::assertSame ('' , $ response ->data ['certificateState ' ]['local_path ' ] ?? null );
65+ self ::assertFalse ($ response ->data ['certificateState ' ]['has_local_certificate ' ] ?? true );
66+ self ::assertFalse ($ response ->data ['certificateState ' ]['has_saved_settings ' ] ?? true );
67+ }
68+
5569 public function testPrepareNfseInputNormalizesFieldsAndPreservesExistingSecretsWithoutCertificateReplacement (): void
5670 {
5771 $ controller = new class () extends SettingsController {
You can’t perform that action at this time.
0 commit comments