示例#1
0
 /**
  * @expectedException Zend_Barcode_Renderer_Exception
  */
 public function testRendererWithUnkownInstructionProvideByObject()
 {
     require_once dirname(__FILE__) . '/../Object/_files/BarcodeTest.php';
     $object = new Zend_Barcode_Object_Test();
     $object->setText('test');
     $object->addInstruction(array('type' => 'unknown'));
     $this->_renderer->setBarcode($object);
     $this->_renderer->draw();
 }
示例#2
0
 public function testAddTextWithDefaultColor()
 {
     $object = new Zend_Barcode_Object_Test();
     $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());
 }