File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 99
1010use donatj \MockWebServer \MockWebServer ;
1111use donatj \MockWebServer \Response ;
12+ use LibreCodeCoop \NfsePHP \Contracts \XmlSignerInterface ;
1213use LibreCodeCoop \NfsePHP \Dto \DpsData ;
1314use LibreCodeCoop \NfsePHP \Http \NfseClient ;
1415use LibreCodeCoop \NfsePHP \SecretStore \NoOpSecretStore ;
2223class NfseClientTest extends TestCase
2324{
2425 private static MockWebServer $ server ;
26+ private XmlSignerInterface $ signer ;
2527
2628 public static function setUpBeforeClass (): void
2729 {
@@ -34,6 +36,18 @@ public static function tearDownAfterClass(): void
3436 self ::$ server ->stop ();
3537 }
3638
39+ protected function setUp (): void
40+ {
41+ parent ::setUp ();
42+
43+ $ this ->signer = new class () implements XmlSignerInterface {
44+ public function sign (string $ xml , string $ cnpj ): string
45+ {
46+ return $ xml ;
47+ }
48+ };
49+ }
50+
3751 public function testEmitReturnsReceiptDataOnSuccess (): void
3852 {
3953 $ payload = json_encode ([
@@ -52,6 +66,7 @@ public function testEmitReturnsReceiptDataOnSuccess(): void
5266 secretStore: $ store ,
5367 sandboxMode: false ,
5468 baseUrlOverride: self ::$ server ->getServerRoot () . '/NFS-e/api/v1 ' ,
69+ signer: $ this ->signer ,
5570 );
5671
5772 $ dps = $ this ->makeDps ();
You can’t perform that action at this time.
0 commit comments