appdb/ include/image.php unit_test/test_image.php
WineHQ
wineowner at wine.codeweavers.com
Wed Aug 30 21:23:01 CDT 2006
ChangeSet ID: 27742
CVSROOT: /opt/cvs-commit
Module name: appdb
Changes by: wineowner at winehq.org 2006/08/30 21:23:01
Modified files:
include : image.php
unit_test : test_image.php
Log message:
"EA Durbin" <ead1234 at hotmail.com>
Fix a misnamed variable in image::resize_image_border() and add a unit test to make sure we call this function to test it
Patch: http://cvs.winehq.org/patch.py?id=27742
Old revision New revision Changes Path
1.6 1.7 +1 -1 appdb/include/image.php
1.1 1.2 +21 -1 appdb/unit_test/test_image.php
Index: appdb/include/image.php
diff -u -p appdb/include/image.php:1.6 appdb/include/image.php:1.7
--- appdb/include/image.php:1.6 31 Aug 2006 2:23: 1 -0000
+++ appdb/include/image.php 31 Aug 2006 2:23: 1 -0000
@@ -270,7 +270,7 @@ class Image {
." in $sBorderColor");
imagedestroy($this->oImage);
$this->oImage = $new;
- $this->iWidth = $new_witdh;
+ $this->iWidth = $iNewWidth;
$this->iHeight= $iNewHeight;
}
Index: appdb/unit_test/test_image.php
diff -u -p appdb/unit_test/test_image.php:1.1 appdb/unit_test/test_image.php:1.2
--- appdb/unit_test/test_image.php:1.1 31 Aug 2006 2:23: 1 -0000
+++ appdb/unit_test/test_image.php 31 Aug 2006 2:23: 1 -0000
@@ -217,7 +217,23 @@ function test_image_add_watermark()
return true;
}
+function test_resize_image_border()
+{
+ test_start(__FUNCTION__);
+ $sBorderColor = '#00EEFF';
+ $iBorderWidth = 1;
+ $iNewWidth = 3;
+ $iNewHeight = 3;
+ $sImageFilename = TEST_IMAGE_FILENAME;
+ /* create a new image from a known image file */
+ $oImage = new Image($sImageFilename);
+
+ /* resize the image with a border */
+ $oImage->resize_image_border($sBorderColor, $iBorderWidth, $iNewWidth, $iNewHeight);
+
+ return true;
+}
if(!test_image_constructor())
@@ -245,4 +261,8 @@ if(!test_image_add_watermark())
else
echo "test_image_add_watermark() passed\n";
-?>
\ No newline at end of file
+if(!test_resize_image_border())
+ echo "test_resize_image_border() failed!\n";
+else
+ echo "test_resize_image_border() passed\n";
+?>
More information about the wine-cvs
mailing list