Code Duplication    Length = 28-30 lines in 3 locations

tests/unit/Field/Parser/BarcodeParserTest.php 1 location

@@ 7-34 (lines=28) @@
4
5
use Graze\CiffRenderer\Field\Parser\BarcodeParser;
6
7
class BarcodeParserTest extends \PHPUnit_Framework_TestCase
8
{
9
    /**
10
     * @var \Graze\CiffRenderer\Field\Parser\ParserInterface
11
     */
12
    protected $parser;
13
14
    public function setUp()
15
    {
16
        $pathToFixture = sprintf('%s/Fixture/BarcodeParserFixture.xml', dirname(__FILE__));
17
18
        $xml = simplexml_load_file($pathToFixture);
19
20
        $this->parser = new BarcodeParser();
21
22
        $this->parser->setXmlField($xml);
23
    }
24
25
    public function testGetFontSize()
26
    {
27
        $this->assertSame(10.0, $this->parser->getFontSize());
28
    }
29
30
    public function testGetIsInverse()
31
    {
32
        $this->assertSame(true, $this->parser->getIsInverse());
33
    }
34
}
35

tests/unit/Field/Parser/DateParser/DateParserTest.php 1 location

@@ 7-36 (lines=30) @@
4
5
use Graze\CiffRenderer\Field\Parser\DateParser\DateParser;
6
7
class DateParserTest extends \PHPUnit_Framework_TestCase
8
{
9
    /**
10
     * @var \Graze\CiffRenderer\Field\Parser\ParserInterface
11
     */
12
    protected $parser;
13
14
    public function setUp()
15
    {
16
        $pathToFixture = sprintf('%s/Fixture/DateParserFixture.xml', dirname(__FILE__));
17
18
        $xml = simplexml_load_file($pathToFixture);
19
20
        $this->parser = new DateParser();
21
22
        $this->parser->setXmlField($xml);
23
    }
24
25
    public function testGetDateFormat()
26
    {
27
        $this->assertSame("dd''MM''yyyy", $this->parser->getDateFormat());
28
    }
29
30
    public function testGetText()
31
    {
32
        $expected = (new \DateTime())->format('dmY');
33
34
        $this->assertEquals($expected, $this->parser->getText());
35
    }
36
}
37

tests/unit/Field/Parser/GraphicPrimitiveParserTest.php 1 location

@@ 7-34 (lines=28) @@
4
5
use Graze\CiffRenderer\Field\Parser\GraphicPrimitiveParser;
6
7
class GraphicPrimitiveParserTest extends \PHPUnit_Framework_TestCase
8
{
9
    /**
10
     * @var \Graze\CiffRenderer\Field\Parser\ParserInterface
11
     */
12
    protected $parser;
13
14
    public function setUp()
15
    {
16
        $pathToFixture = sprintf('%s/Fixture/GraphicPrimitiveParserFixture.xml', dirname(__FILE__));
17
18
        $xml = simplexml_load_file($pathToFixture);
19
20
        $this->parser = new GraphicPrimitiveParser();
21
22
        $this->parser->setXmlField($xml);
23
    }
24
25
    public function testGetShape()
26
    {
27
        $this->assertEquals('OutlineBox', $this->parser->getShape());
28
    }
29
30
    public function testGetLineWeight()
31
    {
32
        $this->assertEquals(25, $this->parser->getLineWeight());
33
    }
34
}
35