コード例 #1
0
ファイル: test_case.php プロジェクト: bmdevel/ezc
 public function __construct()
 {
     parent::__construct();
     $dataDir = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'data';
     foreach (glob($dataDir . DIRECTORY_SEPARATOR . '*') as $testFile) {
         if (!is_file($testFile)) {
             continue;
         }
         $pathInfo = pathinfo($testFile);
         $this->testFiles[basename($pathInfo["basename"], "." . $pathInfo["extension"])] = realpath($testFile);
     }
     $this->testFiles["nonexistent"] = "nonexistent.jpg";
     $this->referencePath = $dataDir . DIRECTORY_SEPARATOR . 'compare';
 }
コード例 #2
0
 public function setUp()
 {
     parent::setUp();
     if (!ezcBaseFeatures::hasExtensionSupport('cairo_wrapper')) {
         $this->markTestSkipped('This test needs pecl/cairo_wrapper support.');
     }
     static $i = 0;
     $this->tempDir = $this->createTempDir(__CLASS__ . sprintf('_%03d_', ++$i)) . '/';
     $this->basePath = dirname(__FILE__) . '/data/';
     $this->driver = new ezcGraphCairoDriver();
     $this->driver->options->width = 200;
     $this->driver->options->height = 100;
     $this->driver->options->font->path = $this->basePath . 'font.ttf';
 }
コード例 #3
0
 public function __construct()
 {
     parent::__construct();
     $dataDir = dirname(__FILE__) . "/data";
     foreach (glob("{$dataDir}/*") as $testFile) {
         if (!is_file($testFile)) {
             continue;
         }
         $pathInfo = pathinfo($testFile);
         $this->testFiles[basename($pathInfo["basename"], "." . $pathInfo["extension"])] = realpath($testFile);
     }
     $this->testFiles["nonexistent"] = "nonexistent.jpg";
     $this->referencePath = "{$dataDir}/compare";
 }
コード例 #4
0
 public function setUp()
 {
     parent::setUp();
     if (!ezcBaseFeatures::hasExtensionSupport('gd') && (ezcBaseFeatures::hasFunction('imagefttext') || ezcBaseFeatures::hasFunction('imagettftext'))) {
         $this->markTestSkipped('This test needs ext/gd with native ttf support or FreeType 2 support.');
     }
     static $i = 0;
     $this->tempDir = $this->createTempDir(__CLASS__ . sprintf('_%03d_', ++$i)) . '/';
     $this->basePath = dirname(__FILE__) . '/data/';
     $this->driver = new ezcGraphGdDriver();
     $this->driver->options->width = 200;
     $this->driver->options->height = 100;
     $this->driver->options->font->path = $this->basePath . 'font.ttf';
     $this->driver->options->supersampling = 1;
 }