Skip to content

Commit

Permalink
Adicionados campos novos à sondagem
Browse files Browse the repository at this point in the history
  • Loading branch information
DenysXavier committed Aug 6, 2018
1 parent 3ac90be commit 1a04d7f
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/InstrucoesDeTitulo.php
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,11 @@ public function carregarPorXML(\DOMDocument $xml) {
$this->setTipoProtesto($leitor->getValorNo("tpProtesto"));
$this->setValorAbatimento($leitor->getValorNo("vlAbatimento") / 100);
$this->setValorDesconto($leitor->getValorNo("vlDesc") / 100);
$this->setTipoPagamento($leitor->getValorNo("tipoPagto"));
$this->setQtdParciais($leitor->getValorNo("qtdParciais"));
$this->setTipoValor($leitor->getValorNo("tipoValor"));
$this->setPercentualMaximo($leitor->getValorNo("valorMaximo") / 100000);
$this->setPercentualMinimo($leitor->getValorNo("valorMinimo") / 100000);
}

}
15 changes: 14 additions & 1 deletion tests/BoletoSantanderServicoTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,15 @@ public static function setUpBeforeClass() {

$convenio = new Convenio();
$pagador = new Pagador(1, mt_rand(100000, 999999), self::$faker->name, self::$faker->streetAddress, self::$faker->city, self::$faker->city, self::$faker->stateAbbr, self::$faker->postcode);
$titulo = new Titulo(mt_rand(0, 9999999), mt_rand(100000000, 999999999), mt_rand(100000000, 999999999), "now", NULL, NULL, NULL, new InstrucoesDeTitulo());

$instrucoesDeTitulo = new InstrucoesDeTitulo();
$instrucoesDeTitulo->setTipoPagamento(3);
$instrucoesDeTitulo->setTipoValor(1);
$instrucoesDeTitulo->setPercentualMaximo(mt_rand(0, 9999999) . "." . mt_rand(0, 99999));
$instrucoesDeTitulo->setPercentualMinimo(mt_rand(0, 9999999) . "." . mt_rand(0, 99999));
$instrucoesDeTitulo->setQtdParciais(mt_rand(1, 99));

$titulo = new Titulo(mt_rand(0, 9999999), mt_rand(100000000, 999999999), mt_rand(100000000, 999999999), "now", NULL, NULL, NULL, $instrucoesDeTitulo);

self::$boleto = new Boleto($convenio, $pagador, $titulo);

Expand Down Expand Up @@ -215,9 +223,14 @@ public function testeParaSondarUmTitulo() {
<qtDiasBaixa>' . self::$boleto->getTitulo()->getInstrucoes()->getBaixarApos() . '</qtDiasBaixa>
<qtDiasMulta>' . self::$boleto->getTitulo()->getInstrucoes()->getMultarApos() . '</qtDiasMulta>
<qtDiasProtesto>' . self::$boleto->getTitulo()->getInstrucoes()->getProtestarApos() . '</qtDiasProtesto>
<qtdParciais>' . self::$boleto->getTitulo()->getInstrucoes()->getQtdParciais() . '</qtdParciais>
<seuNumero>' . self::$boleto->getTitulo()->getSeuNumero() . '</seuNumero>
<tipoPagto>' . self::$boleto->getTitulo()->getInstrucoes()->getTipoPagamento() . '</tipoPagto>
<tipoValor>' . self::$boleto->getTitulo()->getInstrucoes()->getTipoValor() . '</tipoValor>
<tpDesc>' . self::$boleto->getTitulo()->getInstrucoes()->getTipoDesconto() . '</tpDesc>
<tpProtesto>' . self::$boleto->getTitulo()->getInstrucoes()->getTipoProtesto() . '</tpProtesto>
<valorMaximo>' . \TIExpert\WSBoletoSantander\Util::formatarNumero(self::$boleto->getTitulo()->getInstrucoes()->getPercentualMaximo(), 5, '') . '</valorMaximo>
<valorMinimo>' . \TIExpert\WSBoletoSantander\Util::formatarNumero(self::$boleto->getTitulo()->getInstrucoes()->getPercentualMinimo(), 5, '') . '</valorMinimo>
<vlAbatimento>' . self::$boleto->getTitulo()->getInstrucoes()->getValorAbatimento() * 100 . '</vlAbatimento>
<vlDesc>' . self::$boleto->getTitulo()->getInstrucoes()->getValorDesconto() * 100 . '</vlDesc>
<vlNominal>' . self::$boleto->getTitulo()->getValor() * 100 . '</vlNominal>
Expand Down
5 changes: 5 additions & 0 deletions tests/TituloTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,11 @@ public function aoSondarUmTituloODigitoVerificadorDoNossoNumeroDeveSerRemovido()
<seuNumero>000000000123456</seuNumero>
<tpDesc>0</tpDesc>
<tpProtesto>0</tpProtesto>
<tipoValor>0</tipoValor>
<tipoPagto>1</tipoPagto>
<qtdParciais>00</qtdParciais>
<valorMaximo>00000000000000000</valorMaximo>
<valorMinimo>00000000000000000</valorMinimo>
<vlAbatimento>000000000000000</vlAbatimento>
<vlDesc>000000000000000</vlDesc>
<vlNominal>000000000000110</vlNominal>
Expand Down

0 comments on commit 1a04d7f

Please sign in to comment.