/**
  * Draw the barcode in the rendering resource
  * @return mixed
  */
 public function draw()
 {
     try {
         $this->checkParams();
         $this->_initRenderer();
         $this->_drawInstructionList();
     } catch (Zend_Exception $e) {
         $renderable = false;
         if ($e instanceof Zend_Barcode_Exception) {
             $renderable = $e->isRenderable();
         }
         if ($this->_automaticRenderError && $renderable) {
             $barcode = Zend_Barcode::makeBarcode('error', array('text' => $e->getMessage()));
             $this->setBarcode($barcode);
             $this->_resource = null;
             $this->_initRenderer();
             $this->_drawInstructionList();
         } else {
             if ($e instanceof Zend_Barcode_Exception) {
                 $e->setIsRenderable(false);
             }
             throw $e;
         }
     }
     return $this->_resource;
 }
Exemple #2
0
 /**
  * @expectedException PHPUnit_Framework_Error
  */
 public function testBarcodeObjectFactoryWithUnexistantBarcode()
 {
     $barcode = Zend_Barcode::makeBarcode('zf123', array());
 }