5
5
6
6
use phpDocumentor \Reflection \Types \Integer ;
7
7
use Simonetti \MultiCTe \Soap \AlterarCTe ;
8
+ use Simonetti \MultiCTe \Soap \CancelarCTe ;
8
9
use Simonetti \MultiCTe \Soap \CTe ;
9
10
use Simonetti \MultiCTe \Soap \IntegracaoCTe ;
10
11
use Simonetti \MultiCTe \Soap \BuscarPorCodigoCTe ;
@@ -51,7 +52,7 @@ public function testDeveriaIntegrarCTeSemErro()
51
52
52
53
$ integrarCTe ->cte = new CTe ();
53
54
54
- $ integrarCTe -> cte -> CFOP = 6932 ;
55
+
55
56
$ integrarCTe ->cte ->CodigoIBGECidadeInicioPrestacao = 3204104 ;
56
57
$ integrarCTe ->cte ->CodigoIBGECidadeTerminoPrestacao = 1504422 ;
57
58
@@ -63,7 +64,7 @@ public function testDeveriaIntegrarCTeSemErro()
63
64
64
65
$ integrarCTe ->cte ->ComponentesDaPrestacao = $ componentesPrestacao ;
65
66
66
- $ integrarCTe ->cte ->DataPrevistaEntrega = '15 /11/2016 ' ;
67
+ $ integrarCTe ->cte ->DataPrevistaEntrega = '30 /11/2016 ' ;
67
68
68
69
$ destinatario = new Cliente ();
69
70
$ destinatario ->Bairro = 'JDIM STA FRANCISCA ' ;
@@ -182,6 +183,7 @@ public function testDeveriaIntegrarCTeSemErro()
182
183
$ this ->assertEquals ('Integração realizada com sucesso. ' , $ retorno ->IntegrarCTeResult ->Mensagem );
183
184
}
184
185
186
+
185
187
/**
186
188
* @expectedException \Exception
187
189
*/
@@ -322,7 +324,7 @@ public function testDeveriaLancarExceptionDevidoFormatacaoErradaCampoMotorista()
322
324
public function testDeveriaBuscarPorCodigoCTeSemErro ()
323
325
{
324
326
$ busca = new BuscarPorCodigoCTe ();
325
- $ busca ->codigoCTe = 37 ;
327
+ $ busca ->codigoCTe = 2058 ;
326
328
$ busca ->tipoIntegracao = 'Emissao ' ;
327
329
$ busca ->tipoRetorno = 'XML_PDF ' ;
328
330
$ busca ->token = $ this ->token ;
@@ -502,4 +504,20 @@ public function testDeveriaGerarExceptionDevidoCodigoCTe()
502
504
$ retorno = $ this ->conhecimentoDeTransporteEletronico ->alterarDadosCTe (['AlterarCTe ' => $ alterarCTe ]);
503
505
}
504
506
507
+ /**
508
+ * @expectedException \Exception
509
+ */
510
+ public function testCancelarDeveriaGerarExcecaoDevidoStatusDaCTe ()
511
+ {
512
+ $ cancelarCTe = new CancelarCTe ();
513
+ $ cancelarCTe ->chaveCTe = '32161125255622000191570010000000281000000287 ' ;
514
+ $ cancelarCTe ->justificativa = 'Teste de cancelamento de cte ' ;
515
+ $ cancelarCTe ->cnpjEmpresaAdministradora = '13969629000196 ' ;
516
+ $ cancelarCTe ->token = $ this ->token ;
517
+
518
+ $ retorno = $ this ->conhecimentoDeTransporteEletronico ->cancelarCTe (['CancelarCTe ' => $ cancelarCTe ]);
519
+
520
+ var_dump ($ retorno );
521
+ }
522
+
505
523
}
0 commit comments