test/unit/GdEscposImageTest.php
/**
     * Load an EscposImage with (optionally) certain libraries disabled and run a check.
     */
Load an EscposImage with (optionally) certain libraries disabled and run a check.
Load an EscposImage with ( optionally ) certain libraries disabled and run a check .
private function loadAndCheckImg($fn, $width, $height, $rasterFormat = null, $columnFormat = null)
    {
        if (!EscposImage::isGdLoaded()) {
            $this -> markTestSkipped("gd plugin is required for this test");
        }
        $onDisk = ($fn === null ? null : (dirname(__FILE__) . "/resources/$fn"));
        $imgOptimised = new GdEscposImage($onDisk, true);
        $this -> checkImg($imgOptimised, $width, $height, $rasterFormat, $columnFormat);
        $imgUnoptimised = new GdEscposImage($onDisk, false);
        $this -> checkImg($imgUnoptimised, $width, $height, $rasterFormat, $columnFormat);
    }
private function loadAndCheckImg ( $ fn , $ width , $ height , $ rasterFormat = null , $ columnFormat = null ) { if ( ! EscposImage :: isGdLoaded ( ) ) { $ this -> markTestSkipped ( " gd plugin is required for this test " ) ; } $ onDisk = ( $ fn === null ? null : ( dirname ( __FILE__ ) . " /resources/ $ fn " ) ) ; $ imgOptimised = new GdEscposImage ( $ onDisk , true ) ; $ this -> checkImg ( $ imgOptimised , $ width , $ height , $ rasterFormat , $ columnFormat ) ; $ imgUnoptimised = new GdEscposImage ( $ onDisk , false ) ; $ this -> checkImg ( $ imgUnoptimised , $ width , $ height , $ rasterFormat , $ columnFormat ) ; }
Load an EscposImage with (optionally) certain libraries disabled and run a check.
Load an EscposImage with ( optionally ) certain libraries disabled and run a check .
// With optimisations // ... and without