public function testDrawWithExistantResourceReturnResource() { Zend_Barcode::setBarcodeFont(dirname(__FILE__) . '/../Object/_fonts/Vera.ttf'); $barcode = new Zend_Barcode_Object_Code39(array('text' => '0123456789')); $this->_renderer->setBarcode($barcode); $pdfResource = new Zend_Pdf(); $this->_renderer->setResource($pdfResource); $resource = $this->_renderer->draw(); $this->assertTrue($resource instanceof Zend_Pdf); $this->assertSame($resource, $pdfResource); Zend_Barcode::setBarcodeFont(''); }
public function testDrawWithExistantResourceReturnResource() { Zend_Barcode::setBarcodeFont(dirname(__FILE__) . '/../Object/_fonts/Vera.ttf'); $barcode = new Zend_Barcode_Object_Code39(array('text' => '0123456789')); $this->_renderer->setBarcode($barcode); $svgResource = new DOMDocument(); $rootElement = $svgResource->createElement('svg'); $rootElement->setAttribute('xmlns', "http://www.w3.org/2000/svg"); $rootElement->setAttribute('version', '1.1'); $rootElement->setAttribute('width', 500); $rootElement->setAttribute('height', 300); $svgResource->appendChild($rootElement); $this->_renderer->setResource($svgResource); $resource = $this->_renderer->draw(); $this->assertTrue($resource instanceof DOMDocument); $this->assertSame($resource, $svgResource); Zend_Barcode::setBarcodeFont(''); }
public function testProxyBarcodeObjectFont() { Zend_Barcode::setBarcodeFont('my_font.ttf'); $barcode = new Zend_Barcode_Object_Code25(); $this->assertSame('my_font.ttf', $barcode->getFont()); Zend_Barcode::setBarcodeFont(''); }
/** * @expectedException Zend_Barcode_Renderer_Exception */ public function testNoFontWithOrientation() { Zend_Barcode::setBarcodeFont(''); $barcode = new Zend_Barcode_Object_Code39(array('text' => '0123456789')); $barcode->setOrientation(1); $this->_renderer->setBarcode($barcode); $this->_renderer->draw(); }
public function tearDown() { Zend_Barcode::setBarcodeFont(''); }