From 31ab812ca16680799639344268502d1ee2e887c9 Mon Sep 17 00:00:00 2001 From: Vitor Mattos <1079143+vitormattos@users.noreply.github.com> Date: Sun, 4 Oct 2026 23:23:59 +0000 Subject: [PATCH] test: complete NFS-e schema guard coverage Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com> --- tests/Unit/Xml/DecisionNfseBuilderTest.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tests/Unit/Xml/DecisionNfseBuilderTest.php b/tests/Unit/Xml/DecisionNfseBuilderTest.php index 6b59472..6a40149 100644 --- a/tests/Unit/Xml/DecisionNfseBuilderTest.php +++ b/tests/Unit/Xml/DecisionNfseBuilderTest.php @@ -63,6 +63,21 @@ public function testManualNdfseZeroMakesSchemaConflictExplicit(): void self::assertTrue((bool) array_filter($errors, static fn (string $e): bool => str_contains($e, 'nDFSe'))); } + public function testCompleteNfseValidatorRejectsUnsupportedSchemaVersionExplicitly(): void + { + $this->expectException(\InvalidArgumentException::class); + $this->expectExceptionMessage('Unsupported complete NFS-e schema version: 9.99'); + + new NfseSchemaValidator(schemaVersion: '9.99'); + } + + public function testCompleteNfseValidatorDoesNotResolveExternalEntities(): void + { + $xml = ''; + + self::assertNotSame([], (new NfseSchemaValidator())->validate($xml)); + } + public function testKnownAccessKeyCheckDigit(): void { $key = '35503081206169966000133000000000023726079719343785';