Code Duplication    Length = 25-27 lines in 3 locations

tests/Field/Parser/BarcodeParserTest.php 1 location

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

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

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

tests/Field/Parser/GraphicPrimitiveParserTest.php 1 location

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