public function testBarcodeObjectFactoryWithUnexistantBarcode() { $this->setExpectedException('Zend\\ServiceManager\\Exception\\ServiceNotFoundException'); $barcode = Barcode\Barcode::makeBarcode('zf123', array()); }
public function testBarcodeObjectFactoryWithUnexistantBarcode() { $this->setExpectedException('\Zend\Barcode\Exception\InvalidArgumentException'); $barcode = Barcode\Barcode::makeBarcode('zf123', array()); }
/** * 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; }
/** * @expectedException PHPUnit_Framework_Error */ public function testBarcodeObjectFactoryWithUnexistantBarcode() { $barcode = Barcode\Barcode::makeBarcode('zf123', array()); }
/** * 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; }
public function testBarcodeObjectFactoryWithUnexistantBarcode() { $this->setExpectedException('\\Zend\\Loader\\Exception\\RuntimeException'); $barcode = Barcode\Barcode::makeBarcode('zf123', array()); }