55
66use phpDocumentor \Reflection \Types \Integer ;
77use Simonetti \MultiCTe \Soap \AlterarCTe ;
8+ use Simonetti \MultiCTe \Soap \CancelarCTe ;
89use Simonetti \MultiCTe \Soap \CTe ;
910use Simonetti \MultiCTe \Soap \IntegracaoCTe ;
1011use Simonetti \MultiCTe \Soap \BuscarPorCodigoCTe ;
@@ -51,7 +52,7 @@ public function testDeveriaIntegrarCTeSemErro()
5152
5253 $ integrarCTe ->cte = new CTe ();
5354
54- $ integrarCTe -> cte -> CFOP = 6932 ;
55+
5556 $ integrarCTe ->cte ->CodigoIBGECidadeInicioPrestacao = 3204104 ;
5657 $ integrarCTe ->cte ->CodigoIBGECidadeTerminoPrestacao = 1504422 ;
5758
@@ -63,7 +64,7 @@ public function testDeveriaIntegrarCTeSemErro()
6364
6465 $ integrarCTe ->cte ->ComponentesDaPrestacao = $ componentesPrestacao ;
6566
66- $ integrarCTe ->cte ->DataPrevistaEntrega = '15 /11/2016 ' ;
67+ $ integrarCTe ->cte ->DataPrevistaEntrega = '30 /11/2016 ' ;
6768
6869 $ destinatario = new Cliente ();
6970 $ destinatario ->Bairro = 'JDIM STA FRANCISCA ' ;
@@ -182,6 +183,7 @@ public function testDeveriaIntegrarCTeSemErro()
182183 $ this ->assertEquals ('Integração realizada com sucesso. ' , $ retorno ->IntegrarCTeResult ->Mensagem );
183184 }
184185
186+
185187 /**
186188 * @expectedException \Exception
187189 */
@@ -322,7 +324,7 @@ public function testDeveriaLancarExceptionDevidoFormatacaoErradaCampoMotorista()
322324 public function testDeveriaBuscarPorCodigoCTeSemErro ()
323325 {
324326 $ busca = new BuscarPorCodigoCTe ();
325- $ busca ->codigoCTe = 37 ;
327+ $ busca ->codigoCTe = 2058 ;
326328 $ busca ->tipoIntegracao = 'Emissao ' ;
327329 $ busca ->tipoRetorno = 'XML_PDF ' ;
328330 $ busca ->token = $ this ->token ;
@@ -502,4 +504,20 @@ public function testDeveriaGerarExceptionDevidoCodigoCTe()
502504 $ retorno = $ this ->conhecimentoDeTransporteEletronico ->alterarDadosCTe (['AlterarCTe ' => $ alterarCTe ]);
503505 }
504506
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+
505523}
0 commit comments