Permalink
Browse files

added bandTest Case

  • Loading branch information...
adrianj98 committed Dec 13, 2012
1 parent 298d3dd commit 0992a7f1410fe07e8df122daa6fcd94e818cad11
Showing with 189 additions and 0 deletions.
  1. +189 −0 tests/class/parser/JasperBandTest.php
@@ -0,0 +1,189 @@
+<?php
+
+require_once dirname(__FILE__) . '/../../../class/parser/JasperBand.php';
+
+/**
+ * Test class for JasperBand.
+ * Generated by PHPUnit on 2012-08-25 at 15:23:15.
+ */
+class JasperBandTest extends PHPUnit_Framework_TestCase {
+
+ /**
+ * @var JasperBand
+ */
+ protected $object;
+
+ /**
+ * Sets up the fixture, for example, opens a network connection.
+ * This method is called before a test is executed.
+ */
+ protected function setUp() {
+ $this->object = new JasperBand();
+ }
+
+ /**
+ * Tears down the fixture, for example, closes a network connection.
+ * This method is called after a test is executed.
+ */
+ protected function tearDown() {
+
+ }
+
+ /**
+ * @covers JasperBand::addElement
+ * @todo Implement testAddElement().
+ */
+ public function testAddElement() {
+ // Remove the following lines when you implement this test.
+ $this->markTestIncomplete(
+ 'This test has not been implemented yet.'
+ );
+ }
+
+ /**
+ * @covers JasperBand::parse
+ * @todo Implement testParse().
+ */
+ public function testParse() {
+
+ $xml = simplexml_load_string($this->testBand);
+
+ $this->object->parse($xml);
+ $this->assertEquals('177',$this->object->height);
+ $this->assertEquals('Stretch',$this->object->splitType);
+ $this->assertEmpty($this->object->isSplitAllowed);
+
+ }
+
+ /**
+ * @covers JasperBand::parseElements
+ * @todo Implement testParseElements().
+ */
+ public function testParseElements() {
+ // Remove the following lines when you implement this test.
+ $this->markTestIncomplete(
+ 'This test has not been implemented yet.'
+ );
+ }
+
+
+
+ public $testBand = '<pageHeader>
+ <band height="177" splitType="Stretch">
+ <textField>
+ <reportElement x="478" y="98" width="69" height="20"/>
+ <textElement/>
+ <textFieldExpression><![CDATA[$F{sample2_date}]]></textFieldExpression>
+ </textField>
+ <textField>
+ <reportElement x="478" y="78" width="69" height="20"/>
+ <textElement>
+ <font isBold="true"/>
+ </textElement>
+ <textFieldExpression><![CDATA[$F{sample2_docno}]]></textFieldExpression>
+ </textField>
+ <textField>
+ <reportElement x="5" y="78" width="238" height="20"/>
+ <textElement>
+ <font size="12" isBold="true"/>
+ </textElement>
+ <textFieldExpression><![CDATA[$F{sample2_companyname}]]></textFieldExpression>
+ </textField>
+ <textField>
+ <reportElement x="5" y="98" width="238" height="20"/>
+ <textElement/>
+ <textFieldExpression><![CDATA[$F{sample2_address}]]></textFieldExpression>
+ </textField>
+ <textField>
+ <reportElement x="478" y="118" width="69" height="20"/>
+ <textElement/>
+ <textFieldExpression><![CDATA[$F{sample2_terms}]]></textFieldExpression>
+ </textField>
+ <staticText>
+ <reportElement x="243" y="78" width="52" height="20"/>
+ <textElement/>
+ <text><![CDATA[PO No :]]></text>
+ </staticText>
+ <staticText>
+ <reportElement x="423" y="98" width="52" height="20"/>
+ <textElement/>
+ <text><![CDATA[PO Date :]]></text>
+ </staticText>
+ <staticText>
+ <reportElement x="423" y="118" width="52" height="20"/>
+ <textElement/>
+ <text><![CDATA[Terms :]]></text>
+ </staticText>
+ <image>
+ <reportElement x="2" y="0" width="65" height="65"/>
+ <imageExpression><![CDATA["./simitlogo.jpg"]]></imageExpression>
+ </image>
+ <staticText>
+ <reportElement x="204" y="118" width="185" height="20"/>
+ <textElement textAlignment="Center">
+ <font size="14" isBold="true" isUnderline="true"/>
+ </textElement>
+ <text><![CDATA[Purchase Order]]></text>
+ </staticText>
+ <staticText>
+ <reportElement x="74" y="5" width="288" height="19" forecolor="#D6D6D6"/>
+ <textElement>
+ <font size="12" isBold="true"/>
+ </textElement>
+ <text><![CDATA[Sim IT Sdn Bhd]]></text>
+ </staticText>
+ <staticText>
+ <reportElement x="74" y="24" width="325" height="19"/>
+ <textElement/>
+ <text><![CDATA[10B-1, Jalan Mawar 4, 81900 Kota Tinggi, Johor, Malaysia]]></text>
+ </staticText>
+ <staticText>
+ <reportElement x="74" y="43" width="473" height="20"/>
+ <textElement/>
+ <text><![CDATA[Tel: 078835330, Fax: 078835330 Website: http://www.simit.com.my Email: sales@simit.com.my]]></text>
+ </staticText>
+ <staticText>
+ <reportElement x="0" y="157" width="22" height="20"/>
+ <textElement textAlignment="Center">
+ <font size="12" isBold="true" isUnderline="true"/>
+ </textElement>
+ <text><![CDATA[No]]></text>
+ </staticText>
+ <staticText>
+ <reportElement x="22" y="157" width="258" height="20"/>
+ <textElement textAlignment="Center">
+ <font size="12" isBold="true" isUnderline="true"/>
+ </textElement>
+ <text><![CDATA[Item]]></text>
+ </staticText>
+ <staticText>
+ <reportElement x="352" y="157" width="87" height="20"/>
+ <textElement textAlignment="Center">
+ <font size="12" isBold="true" isUnderline="true"/>
+ </textElement>
+ <text><![CDATA[Qty]]></text>
+ </staticText>
+ <staticText>
+ <reportElement x="439" y="157" width="100" height="20"/>
+ <textElement textAlignment="Center">
+ <font size="12" isBold="true" isUnderline="true"/>
+ </textElement>
+ <text><![CDATA[Amount]]></text>
+ </staticText>
+ <staticText>
+ <reportElement x="280" y="157" width="72" height="20"/>
+ <textElement textAlignment="Center">
+ <font size="12" isBold="true" isUnderline="true"/>
+ </textElement>
+ <text><![CDATA[Unit Price]]></text>
+ </staticText>
+ <textField>
+ <reportElement x="343" y="66" width="100" height="20"/>
+ <textElement/>
+ <textFieldExpression><![CDATA[$F{sample2_date}]]></textFieldExpression>
+ </textField>
+ </band>
+ </pageHeader>';
+}
+
+

0 comments on commit 0992a7f

Please sign in to comment.