Add test for the now fixed issue of not correctly setting the image's mime type
authorMichael J. Rubinsky <mrubinsk@horde.org>
Sat, 20 Feb 2010 20:34:47 +0000 (15:34 -0500)
committerMichael J. Rubinsky <mrubinsk@horde.org>
Sat, 20 Feb 2010 20:36:23 +0000 (15:36 -0500)
framework/Image/tests/im.php
framework/Image/tests/runtest.php

index b0a2126..a9425c3 100644 (file)
@@ -227,8 +227,7 @@ case 'testRoundCornersDropShadowYellowBG':
 case 'testBorderedDropShadowTransparentBG':
     $time = xdebug_time_index();
 
-    $image = getImageObject(array('filename' => 'img1.jpg',
-                                  'background' => 'none'));
+    $image = getImageObject(array('filename' => 'img1.jpg'));
     $image->resize(150,150, true);
     $image->addEffect('Border', array('bordercolor' => '#333', 'borderwidth' => 1));
     $image->addEffect('DropShadow',
@@ -242,6 +241,20 @@ case 'testBorderedDropShadowTransparentBG':
     logThis($test, $time, $memory);
     break;
 
+case 'testBorderedDropShadowTransparentLoadString':
+    $image = getImageObject();
+    $data = file_get_contents('img1.jpg');
+    $image->loadString($data);
+    $image->resize(150,150, true);
+    $image->addEffect('Border', array('bordercolor' => '#333', 'borderwidth' => 1));
+    $image->addEffect('DropShadow',
+                      array('background' => 'none',
+                            'padding' => 5,
+                            'distance' => 8,
+                            'fade' => 2));
+    $image->display();
+    break;
+
 case 'testBorderedDropShadowBlueBG':
     $time = xdebug_time_index();
     $image = getImageObject(array('filename' => 'img1.jpg',
@@ -426,7 +439,6 @@ function getImageObject($params = array())
 {
     global $conf;
 
-    // Always pass the convert parameter to be consistent when profiling.
     $context = array('tmpdir' => Horde::getTempDir(),
                      'convert' => $GLOBALS['convert'],
                      'logger' => $GLOBALS['logger'],
index e586558..69b7129 100644 (file)
@@ -18,6 +18,7 @@ $allTests = array(
     'testRoundCornersDropShadowTransparentBG' => 'Rounded corners with a drop shadow on a transparent background.',
     'testRoundCornersDropShadowYellowBG' => 'Rounded corners, with a drop shadow on a yellow background',
     'testBorderedDropShadowTransparentBG' => 'Thumbnail with border and drop shadow over a transparent background.',
+    'testBorderedDropShadowTransparentLoadString' => 'Same as above, but using loadString after the image has been instantiated.',
     'testBorderedDropShadowBlueBG' => 'Thumbnail with border, drop shadow over a blue background.',
     'testPolaroidTransparentBG' => 'Polaroid effect with transparent background.',
     'testPolaroidBlueBG' => 'Polaroid effect with blue background.',