public function testNoFontWithOrientation() { $this->setExpectedException('\\Zend\\Barcode\\Renderer\\Exception\\ExceptionInterface'); Barcode\Barcode::setBarcodeFont(null); $barcode = new Object\Code39(array('text' => '0123456789')); $barcode->setOrientation(1); $this->renderer->setBarcode($barcode); $this->renderer->draw(); }
public function testTopOffsetOverrideVerticalPosition() { $renderer = $this->_getRendererWithWidth500AndHeight300(); $renderer->setModuleSize(1); $barcode = new Object\Code39(array('text' => '0123456789')); $this->assertEquals(62, $barcode->getHeight()); $renderer->setBarcode($barcode); $renderer->setTopOffset(12); $renderer->setVerticalPosition('middle'); $renderer->draw(); $this->assertEquals(12, $renderer->getTopOffset()); }
public function testVerticalPositionToBottom() { $renderer = $this->getRendererWithWidth500AndHeight300(); $barcode = new Object\Code39(array('text' => '0123456789')); $this->assertEquals(62, $barcode->getHeight()); $renderer->setBarcode($barcode); $renderer->setVerticalPosition('bottom'); $renderer->draw(); $this->assertEquals(269, $renderer->getTopOffset()); }
/** * @expectedException \Zend\Barcode\Renderer\Exception */ public function testNoFontWithOrientation() { Barcode\Barcode::setBarcodeFont(null); $barcode = new Object\Code39(array('text' => '0123456789')); $barcode->setOrientation(1); $this->_renderer->setBarcode($barcode); $this->_renderer->draw(); }