From: Michael J. Rubinsky Date: Sun, 14 Feb 2010 16:53:11 +0000 (-0500) Subject: update tests X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=0e41a576f6283cb8e9b0bf2f0ee35ebf739e8396;p=horde.git update tests --- diff --git a/framework/Image/tests/im.php b/framework/Image/tests/im.php index 84c8d105b..fd1b0930e 100644 --- a/framework/Image/tests/im.php +++ b/framework/Image/tests/im.php @@ -7,9 +7,8 @@ * * @package Horde_Image */ -define('HORDE_BASE', '/var/www/html/horde'); -$horde_authentication = 'none'; -require_once HORDE_BASE . '/lib/base.php'; +require_once dirname(__FILE__) . '/../../../horde/lib/Application.php'; +Horde_Registry::appInit('horde', array('authentication' => 'none')); $db = $GLOBALS['injector']->getInstance('Horde_Db_Adapter_Base'); // Putting these here so they don't interfere with timing/memory data when @@ -21,6 +20,20 @@ $handler = new Horde_Log_Handler_Stream(fopen('/tmp/imagetest.log','a+')); $logger = new Horde_Log_Logger($handler); switch ($test) { + +case 'multipage': + $time = xdebug_time_index(); + $image = getImageObject(array('filename' => 'two_page.tif.tiff')); + $first = true; + foreach ($image as $index => $imObject) { + if (!$first) { + $image->display(); + } else { + $first = false; + } + } + logThis($test, $time, xdebug_peak_memory_usage()); + case 'testInitialState': // Solid blue background color - basically tests initial state of the // Horde_Image object. diff --git a/framework/Image/tests/runtest.php b/framework/Image/tests/runtest.php index 401b5b1b0..f5986b14b 100644 --- a/framework/Image/tests/runtest.php +++ b/framework/Image/tests/runtest.php @@ -3,8 +3,8 @@ * Test harness for generating the test images for Horde_Image tests */ -define('HORDE_BASE', '/var/www/html/horde'); -require_once HORDE_BASE . '/lib/Application.php'; +require_once dirname(__FILE__) . '/../../../horde/lib/Application.php'; +Horde_Registry::appInit('horde', array('authentication' => 'none')); $allTests = array( 'testInitialState' => 'Test initial state. Solid blue square', @@ -29,6 +29,7 @@ $allTests = array( 'testPolaroidstackBlueBG' => 'Polaroid stack on a blue background', //'testInitialStateAfterLoad' => 'Initial state after loading an existing image.', 'testResize' => 'Test resize method.', + 'multipage' => 'Test Multipage tiffs', ); ?> @@ -40,8 +41,8 @@ $allTests = array( EffectImImagick $description) { - echo '' . $description . '' . Horde::img('im.php?test=' . $name, '', '', '') . '' - . '' . Horde::img('im.php?test=' . $name . '&driver=Imagick', '', '', '') . ''; + echo '' . $description . '' . Horde::img('im.php?test=' . $name, '', '', '') . '' . + '' . Horde::img('im.php?test=' . $name . '&driver=Imagick', '', '', '') . ''; } echo ''; ?> diff --git a/framework/Image/tests/two_page.tif.tiff b/framework/Image/tests/two_page.tif.tiff new file mode 100644 index 000000000..6b288c3f1 Binary files /dev/null and b/framework/Image/tests/two_page.tif.tiff differ