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 tearDown() { Barcode\Barcode::setBarcodeFont(null); if (!empty($this->originaltimezone)) { date_default_timezone_set($this->originaltimezone); } }
public function testStaticFontAsNumber() { for ($i = 1; $i < 5; $i++) { Barcode\Barcode::setBarcodeFont($i); $this->assertEquals('', $this->_object->getFont()); $object = $this->_getBarcodeObject(); $this->assertEquals($i, $object->getFont()); Barcode\Barcode::setBarcodeFont(''); } }
public function testDrawWithExistantResourceReturnResource() { Barcode\Barcode::setBarcodeFont(__DIR__ . '/../Object/_fonts/Vera.ttf'); $barcode = new Object\Code39(array('text' => '0123456789')); $this->renderer->setBarcode($barcode); $pdfResource = new Pdf\PdfDocument(); $this->renderer->setResource($pdfResource); $resource = $this->renderer->draw(); $this->assertTrue($resource instanceof Pdf\PdfDocument); $this->assertSame($resource, $pdfResource); Barcode\Barcode::setBarcodeFont(''); }
public function testDrawWithExistantResourceReturnResource() { Barcode\Barcode::setBarcodeFont(__DIR__ . '/../Object/_fonts/Vera.ttf'); $barcode = new 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); Barcode\Barcode::setBarcodeFont(''); }
public function testProxyBarcodeObjectFont() { Barcode\Barcode::setBarcodeFont('my_font.ttf'); $barcode = new Object\Code25(); $this->assertSame('my_font.ttf', $barcode->getFont()); Barcode\Barcode::setBarcodeFont(''); }
public function tearDown() { Barcode\Barcode::setBarcodeFont(null); }
public function tearDown() { Barcode\Barcode::setBarcodeFont(null); date_default_timezone_set($this->_originaltimezone); }
/** * @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(); }