Skip to content

Commit

Permalink
Tarefa #3904 Verificação para impressão de total
Browse files Browse the repository at this point in the history
  • Loading branch information
ricardoapaes committed Feb 11, 2020
1 parent 205051a commit fb00626
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tests/SubstrTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,4 +85,21 @@ public function testSubstrNoExact4() {
$this->assertEquals("<h>Borda</h> CHOCOLATE PRETO NO", HtmlString::get(HtmlStringTest::EXEMPLO)->substr(47,24,false));
}

public function testSubstrTotal() {
$texto = "Tributos Totais Incidentes............................R$ 346,49";
$textoComTags = "<c>{$texto}</c>";

$this->assertEquals("Tributos Totais Incidentes......................", HtmlString::get($texto)->substr(0,48,true));
$this->assertEquals("......R$ 346,49", HtmlString::get($texto)->substr(48,48,true));

$this->assertEquals("<c>Tributos Totais Incidentes......................</c>", HtmlString::get($textoComTags)->substr(0,48,true));
$this->assertEquals("<c>......R$ 346,49</c>", HtmlString::get($textoComTags)->substr(48,48,true));

$this->assertEquals("Tributos Totais", HtmlString::get($texto)->substr(0,48,false));
$this->assertEquals("......R$ 346,49", HtmlString::get($texto)->substr(48,48,false));

$this->assertEquals("<c>Tributos Totais</c>", HtmlString::get($textoComTags)->substr(0,48,false));
$this->assertEquals("<c>......R$ 346,49</c>", HtmlString::get($textoComTags)->substr(48,48,false));
}

}

0 comments on commit fb00626

Please sign in to comment.