Skip to content

Commit

Permalink
Correção no setBorder na Tag
Browse files Browse the repository at this point in the history
  • Loading branch information
dbemfica committed Oct 3, 2016
1 parent 9092e99 commit 64eb62d
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 173 deletions.
3 changes: 2 additions & 1 deletion .gitignore
@@ -1,2 +1,3 @@
vendor/
.idea/
.idea/
example/
171 changes: 0 additions & 171 deletions example/index.php

This file was deleted.

12 changes: 11 additions & 1 deletion src/Tag.php
Expand Up @@ -30,7 +30,11 @@ public function loadConfig($template, $path)

$this->width = $std->tag->width;
$this->height = $std->tag->height;
$this->border = $std->tag->border;

if( empty($this->border) ){
$this->border = $std->tag->border;
}

$this->ln = $std->tag->ln;
$this->align = $std->tag->align;
}
Expand All @@ -47,6 +51,12 @@ public function setPadding($padding)
return $this;
}

public function setBorder($border)
{
$this->border = $border;
return $this;
}

public function addP(P $p)
{
$this->p->append($p);
Expand Down
13 changes: 13 additions & 0 deletions tests/TagTest.php
Expand Up @@ -6,6 +6,19 @@

class TagTest extends \PHPUnit_Framework_TestCase
{
function test_border()
{
$template = "teste.json";
$path = dirname(__DIR__) . "/tests/templates/";

$tag = new Tag('teste');
$tag->setBorder(0.1);
$tag->loadConfig($template, $path);

$render = "<div style='width: 10mm;height: 10mm;border: 0.1mm solid black;'><div style='padding: 0mm;'><span style='margin: 0mm;padding: 0mm;'>teste</span></div></div>";
$this->assertEquals($render,$tag->render());
}

function test_render()
{
$template = "teste.json";
Expand Down

0 comments on commit 64eb62d

Please sign in to comment.