public function testRendererWithUnkownInstructionProvideByObject() { $this->setExpectedException('\Zend\Barcode\Renderer\Exception'); $object = new TestAsset\BarcodeTest(); $object->setText('test'); $object->addInstruction(array('type' => 'unknown')); $this->_renderer->setBarcode($object); $this->_renderer->draw(); }
public function testAddTextWithDefaultColor() { $object = new TestAsset\BarcodeTest(); $size = 10; $text = 'foobar'; $position = array(); $font = 'my_font.ttf'; $color = 123456; $object->setForeColor($color); $alignment = 'right'; $orientation = 45; $instructions = array('type' => 'text', 'text' => $text, 'size' => $size, 'position' => $position, 'font' => $font, 'color' => $color, 'alignment' => $alignment, 'orientation' => $orientation); $object->addText($text, $size, $position, $font, null, $alignment, $orientation); $this->assertSame(array($instructions), $object->getInstructions()); }