Skip to content

Commit 30a0600

Browse files
Troca do nome da classe 'cte' para 'CTe'
1 parent 84c0f98 commit 30a0600

File tree

3 files changed

+20
-5
lines changed

3 files changed

+20
-5
lines changed

src/Soap/cte.php renamed to src/Soap/CTe.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
namespace Simonetti\MultiCTe\Soap;
1010

1111

12-
class cte
12+
class CTe
1313
{
1414
/**
1515
* @var int

src/Soap/ConhecimentoDeTransporteEletronico.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,21 @@
99
*/
1010
class ConhecimentoDeTransporteEletronico extends \SoapClient
1111
{
12+
private static $classmap = [
13+
"cte" => "CTe"
14+
];
15+
16+
public function __construct($wsdl, array $options = array())
17+
{
18+
foreach (self::$classmap as $key => $value) {
19+
if (!isset($options['classmap'][$key])) {
20+
$options['classmap'][$key] = $value;
21+
}
22+
}
23+
24+
parent::__construct($wsdl, $options);
25+
}
26+
1227
/**
1328
* @param array $parameters
1429
* @return \stdClass

tests/IntegracaoCTe/IntegracaoCteTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
use phpDocumentor\Reflection\Types\Integer;
77
use Simonetti\MultiCTe\Soap\AlterarCTe;
8-
use Simonetti\MultiCTe\Soap\cte;
8+
use Simonetti\MultiCTe\Soap\CTe;
99
use Simonetti\MultiCTe\Soap\IntegracaoCTe;
1010
use Simonetti\MultiCTe\Soap\BuscarPorCodigoCTe;
1111
use Simonetti\MultiCTe\Soap\ConhecimentoDeTransporteEletronico;
@@ -49,7 +49,7 @@ public function testDeveriaIntegrarCTeSemErro()
4949
{
5050
$integrarCTe = new IntegrarCTe();
5151

52-
$integrarCTe->cte = new cte();
52+
$integrarCTe->cte = new CTe();
5353

5454
$integrarCTe->cte->CFOP = 6932;
5555
$integrarCTe->cte->CodigoIBGECidadeInicioPrestacao = 3204104;
@@ -189,7 +189,7 @@ public function testDeveriaLancarExceptionDevidoFormatacaoErradaCampoMotorista()
189189
{
190190
$integrarCTe = new IntegrarCTe();
191191

192-
$integrarCTe->cte = new cte();
192+
$integrarCTe->cte = new CTe();
193193

194194
$integrarCTe->cte->CFOP = 6932;
195195
$integrarCTe->cte->CodigoIBGECidadeInicioPrestacao = 3204104;
@@ -378,7 +378,7 @@ public function testDeveriaGerarExceptionDevidoCodigoCTe()
378378
$alterarCTe->codigoCTe = -1;
379379
$alterarCTe->cnpjEmpresaAdministradora = '13969629000196';
380380

381-
$cte = new cte();
381+
$cte = new CTe();
382382

383383
$cte->CFOP = 6932;
384384
$cte->CodigoIBGECidadeInicioPrestacao = 3204104;

0 commit comments

Comments
 (0)