Ejemplo n.º 1
0
 public function testBarcodeObjectFactoryWithUnexistantBarcode()
 {
     $this->setExpectedException('Zend\\ServiceManager\\Exception\\ServiceNotFoundException');
     $barcode = Barcode\Barcode::makeBarcode('zf123', array());
 }
Ejemplo n.º 2
0
 public function testBarcodeObjectFactoryWithUnexistantBarcode()
 {
     $this->setExpectedException('\Zend\Barcode\Exception\InvalidArgumentException');
     $barcode = Barcode\Barcode::makeBarcode('zf123', array());
 }
Ejemplo n.º 3
0
 /**
  * Draw the barcode in the rendering resource
  * @return mixed
  */
 public function draw()
 {
     try {
         $this->checkParams();
         $this->initRenderer();
         $this->drawInstructionList();
     } catch (BarcodeException $e) {
         if ($this->automaticRenderError && !$e instanceof BarcodeException\RendererCreationException) {
             $barcode = Barcode::makeBarcode('error', array('text' => $e->getMessage()));
             $this->setBarcode($barcode);
             $this->resource = null;
             $this->initRenderer();
             $this->drawInstructionList();
         } else {
             throw $e;
         }
     }
     return $this->resource;
 }
Ejemplo n.º 4
0
 /**
  * @expectedException PHPUnit_Framework_Error
  */
 public function testBarcodeObjectFactoryWithUnexistantBarcode()
 {
     $barcode = Barcode\Barcode::makeBarcode('zf123', array());
 }
Ejemplo n.º 5
0
 /**
  * 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 Barcode\Exception) {
             $renderable = $e->isRenderable();
         }
         if ($this->_automaticRenderError && $renderable) {
             $barcode = Barcode\Barcode::makeBarcode('error', array('text' => $e->getMessage()));
             $this->setBarcode($barcode);
             $this->_resource = null;
             $this->_initRenderer();
             $this->_drawInstructionList();
         } else {
             if ($e instanceof Barcode\Exception) {
                 $e->setIsRenderable(false);
             }
             throw $e;
         }
     }
     return $this->_resource;
 }
Ejemplo n.º 6
0
 public function testBarcodeObjectFactoryWithUnexistantBarcode()
 {
     $this->setExpectedException('\\Zend\\Loader\\Exception\\RuntimeException');
     $barcode = Barcode\Barcode::makeBarcode('zf123', array());
 }