/**
  * QRCode 2D Matrix-Code PNG rendering test
  *
  * @covers BG\BarcodeBundle\Util\Base2DBarcode::getBarcodePNGPath();
  */
 public function testQRCODEGetBarcodePNGPath()
 {
     $d2 = new matrixCode();
     $d2->savePath = self::C_TMP_PATH;
     $bcPathAbs = $d2->getBarcodePNGPath(self::C_MC_DEFAULT, 'qrcode', self::C_MC_2D_WIDTH, self::C_MC_2D_HEIGHT);
     if (function_exists('imagecreate')) {
         $checkCondition = file_exists($bcPathAbs) && (filesize($bcPathAbs) > 225 && filesize($bcPathAbs) < 255);
     } else {
         $checkCondition = file_exists($bcPathAbs) ? true : false;
     }
     if ($bcPathAbs !== false) {
         unlink($bcPathAbs);
     }
     $this->assertTrue($checkCondition);
 }
Пример #2
0
<?php

namespace BG\Barcode;

include_once '../Base1DBarcode.php';
include_once '../Base2DBarcode.php';
use BG\Barcode\Base1DBarcode as BarCode1D;
use BG\Barcode\Base2DBarcode as BarCode2D;
$bc1d = new BarCode1D();
$bc2d = new BarCode2D();
$bc1d->savePath = $_SERVER['DOCUMENT_ROOT'] . '/tmp/';
$bc2d->savePath = $bc1d->savePath;
?>
<!DOCTYPE html>
<!--[if lt IE 7]>      <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]>         <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]>         <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <title>Barcode Samples 1D/2D</title>
        <meta name="description" content="">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <link rel="stylesheet" href="css/normalize.css">
        <link rel="stylesheet" href="css/main.css">
        <script src="js/vendor/modernizr-2.6.2.min.js"></script>
    </head>
    <body>
        <!--[if lt IE 7]>
            <p class="browsehappy">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p>