update tests
authorMichael J. Rubinsky <mrubinsk@horde.org>
Sun, 14 Feb 2010 16:53:11 +0000 (11:53 -0500)
committerMichael J. Rubinsky <mrubinsk@horde.org>
Sun, 14 Feb 2010 16:53:11 +0000 (11:53 -0500)
framework/Image/tests/im.php
framework/Image/tests/runtest.php
framework/Image/tests/two_page.tif.tiff [new file with mode: 0644]

index 84c8d10..fd1b093 100644 (file)
@@ -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.
index 401b5b1..f5986b1 100644 (file)
@@ -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',
 );
 ?>
 <html>
@@ -40,8 +41,8 @@ $allTests = array(
  <thead><td>Effect</td><td>Im</td><td>Imagick</td></thead>
 <?php
 foreach ($allTests as $name => $description) {
-    echo '<tr><td text-align="top">' . $description . '</td><td>' . Horde::img('im.php?test=' . $name, '', '', '') . '</td>'
-        . '<td text-align="top">' . Horde::img('im.php?test=' . $name . '&driver=Imagick', '', '', '') . '</td>';
+    echo '<tr><td text-align="top">' . $description . '</td><td>' . Horde::img('im.php?test=' . $name, '', '', '') . '</td>' .
+      '<td text-align="top">' . Horde::img('im.php?test=' . $name . '&driver=Imagick', '', '', '') . '</td></tr>';
 }
 echo '</table>';
 ?></body></html>
diff --git a/framework/Image/tests/two_page.tif.tiff b/framework/Image/tests/two_page.tif.tiff
new file mode 100644 (file)
index 0000000..6b288c3
Binary files /dev/null and b/framework/Image/tests/two_page.tif.tiff differ