for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Graze\CiffRenderer\Test\Parser\FieldParser;
use Graze\CiffRenderer\Test\AbstractFieldParserTest;
use Graze\CiffRenderer\Parser\FieldParser\FieldParserStaticGraphic;
use \SimpleXMLElement;
class FieldParserStaticGraphicTest extends AbstractFieldParserTest
{
/**
* @return SimpleXMLElement
*/
private function getXmlField()
return new SimpleXMLElement(
'<Field Name="i am field name">
<FldType>StaticGraphic</FldType>
<CLSID>{6AE09851-D80F-11D4-8DAE-0050DAFE8A9F}</CLSID>
<X>4200</X>
<Y>250</Y>
<W>3775</W>
<H>450</H>
<Ln>1</Ln>
<CalcData><![CDATA[i am path to graphic]]></CalcData>
<Data>
<Object>
<DataType>0</DataType>
<MaxNoOfChars>14</MaxNoOfChars>
<Default><![CDATA[i am path to graphic]]></Default>
</Object>
</Data>
<Graphic>
<GfxW>8500</GfxW>
<GfxH>4700</GfxH>
<StaticGfx>
<AspectRatio>0</AspectRatio>
</StaticGfx>
</Graphic>
</Field>'
);
}
* @return FieldParserStaticGraphic
protected function getParser()
if (!$this->parser) {
$this->parser = new FieldParserStaticGraphic(
$this->fieldParserRegistry,
$this->xmlHeader,
$this->getXmlField(),
$this->scale
return $this->parser;
public function testGetGraphic()
$graphic = 'i am path to graphic';
$this->assertEquals($graphic, $this->getParser()->getGraphic());