<?php

require_once '../libs/ToolsNFePHP.class.php';
$nfe = new ToolsNFePHP();
$nfefile = $nfe->envDir . '35130471780456000160550010000000411000000410-nfe.xml';
$protfile = $nfe->temDir . '35130471780456000160550010000000411000000410-prot.xml';
if ($xml = $nfe->addProt($nfefile, $protfile)) {
    file_put_contents($nfe->aprDir . '35130471780456000160550010000000411000000410-procNfe.xml', $xml);
}
示例#2
0
 public function testAdicionaProtocoloCancelamentoDeNfeHomologado()
 {
     $tool = new ToolsNFePHP($this->configTest, 1, true);
     $xmlNFe = __DIR__ . '/../fixtures/xml/11101284613439000180550010000004881093997017-nfe.xml';
     $xmlProtNFe = __DIR__ . '/../fixtures/xml/11101284613439000180550010000004881093997017-retCancNFe.xml';
     $nfeProtocolada = $tool->addProt($xmlNFe, $xmlProtNFe);
     $expectedDOM = new DOMDocument('1.0', 'UTF-8');
     $expectedDOM->load(__DIR__ . '/../fixtures/xml/11101284613439000180550010000004881093997017-nfeCancNFe.xml');
     $actualDOM = new DOMDocument('1.0', 'UTF-8');
     $actualDOM->loadXML($nfeProtocolada);
     $this->assertEquals($expectedDOM, $actualDOM);
 }