Beispiel #1
0
 public function testAddTextWithDefaultColor()
 {
     $object = new _files\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());
 }
Beispiel #2
0
 /**
  * @expectedException \Zend\Barcode\Renderer\Exception
  */
 public function testRendererWithUnkownInstructionProvideByObject()
 {
     $object = new ObjectNSFiles\BarcodeTest();
     $object->setText('test');
     $object->addInstruction(array('type' => 'unknown'));
     $this->_renderer->setBarcode($object);
     $this->_renderer->draw();
 }