Skip to content
This repository has been archived by the owner on Jan 29, 2020. It is now read-only.

Commit

Permalink
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
10 changes: 9 additions & 1 deletion test/FactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
use Zend\Barcode\Renderer;
use Zend\Barcode\Object;
use Zend\Config\Config;
use Zend\Pdf;
use ZendPdf as Pdf;

/**
* @category Zend
Expand Down Expand Up @@ -345,6 +345,10 @@ public function testProxyBarcodeRendererDrawAsImageAutomaticallyRenderImageIfExc

public function testProxyBarcodeRendererDrawAsPdf()
{
if (!constant('TESTS_ZEND_BARCODE_PDF_SUPPORT')) {
$this->markTestSkipped('Enable TESTS_ZEND_BARCODE_PDF_SUPPORT to test PDF render');
}

Barcode\Barcode::setBarcodeFont(__DIR__ . '/Object/_fonts/Vera.ttf');
$resource = Barcode\Barcode::draw('code25', 'pdf', array('text' => '012345'));
$this->assertTrue($resource instanceof Pdf\PdfDocument);
Expand All @@ -353,6 +357,10 @@ public function testProxyBarcodeRendererDrawAsPdf()

public function testProxyBarcodeRendererDrawAsPdfAutomaticallyRenderPdfIfException()
{
if (!constant('TESTS_ZEND_BARCODE_PDF_SUPPORT')) {
$this->markTestSkipped('Enable TESTS_ZEND_BARCODE_PDF_SUPPORT to test PDF render');
}

Barcode\Barcode::setBarcodeFont(__DIR__ . '/Object/_fonts/Vera.ttf');
$resource = Barcode\Barcode::draw('code25', 'pdf');
$this->assertTrue($resource instanceof Pdf\PdfDocument);
Expand Down
9 changes: 8 additions & 1 deletion test/Renderer/PdfTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

namespace ZendTest\Barcode\Renderer;

use Zend\Pdf;
use ZendPdf as Pdf;
use Zend\Barcode;
use Zend\Barcode\Object;

Expand All @@ -22,6 +22,13 @@
*/
class PdfTest extends TestCommon
{
public function setUp()
{
if (!constant('TESTS_ZEND_BARCODE_PDF_SUPPORT')) {
$this->markTestSkipped('Enable TESTS_ZEND_BARCODE_PDF_SUPPORT to test PDF render');
}
}

protected function getRendererObject($options = null)
{
return new \Zend\Barcode\Renderer\Pdf($options);
Expand Down

0 comments on commit a03898c

Please sign in to comment.