-
-
Notifications
You must be signed in to change notification settings - Fork 395
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
176d392
commit 20b52d1
Showing
4 changed files
with
71 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -181,6 +181,12 @@ public function testFuncaoGerarPixCopiaECola() | |
$this->assertEquals('00020101021226370014br.gov.bcb.pix0115teste@teste.com52040000530398654031005802BR5914NOME_DA_PESSOA6006CIDADE62160512id-transacao6304DA67', $pixCopiaECola); | ||
} | ||
|
||
public function testFuncaoGerarPixCopiaEColaErro() | ||
{ | ||
$this->expectException(Exception::class); | ||
Util::gerarPixCopiaECola('[email protected]', 100.00, 'id-transação', new Pessoa(['nome' => 'NOME_DA_PESSOA', 'cidade' => 'CIDADE'])); | ||
} | ||
|
||
public function testFuncaoDecodePixCopiaECola() | ||
{ | ||
$pixDecoded = Util::decodePixCopiaECola('00020101021226370014br.gov.bcb.pix0115teste@teste.com52040000530398654031005802BR5914NOME_DA_PESSOA6006CIDADE62160512id-transacao6304DA67'); | ||
|
@@ -192,6 +198,16 @@ public function testFuncaoDecodePixCopiaECola() | |
$this->assertEquals('CIDADE', Arr::get($pixDecoded, '60')); | ||
} | ||
|
||
public function testFuncaoGerarPixCopiaEColaEDecodePixCopiaECola() | ||
{ | ||
$pixDecoded = Util::decodePixCopiaECola(Util::gerarPixCopiaECola('[email protected]', 123.45, 'id-transacao-tx', new Pessoa(['nome' => 'NOME DA PESSOA', 'cidade' => 'SÃO PAULO']))); | ||
$this->assertEquals('[email protected]', Arr::get($pixDecoded, '26.01')); | ||
$this->assertEquals('id-transacao-tx', Arr::get($pixDecoded, '62.05')); | ||
$this->assertEquals(123.45, Arr::get($pixDecoded, '54')); | ||
$this->assertEquals('NOME DA PESSOA', Arr::get($pixDecoded, '59')); | ||
$this->assertEquals('SAO PAULO', Arr::get($pixDecoded, '60')); | ||
} | ||
|
||
public function testFuncaoTipoChavePix() | ||
{ | ||
$this->assertEquals(AbstractBoleto::TIPO_CHAVEPIX_EMAIL, Util::tipoChavePix('[email protected]')); | ||
|