Fix a misnamed variable in image::resize_image_border() and add a unit test to make sure we call this function to test it

This commit is contained in:
EA Durbin
2006-08-31 02:23:01 +00:00
committed by WineHQ
parent 320b8c0d82
commit 988be2f138
2 changed files with 22 additions and 2 deletions

View File

@@ -270,7 +270,7 @@ class Image {
." in $sBorderColor");
imagedestroy($this->oImage);
$this->oImage = $new;
$this->iWidth = $new_witdh;
$this->iWidth = $iNewWidth;
$this->iHeight= $iNewHeight;
}

View File

@@ -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";
if(!test_resize_image_border())
echo "test_resize_image_border() failed!\n";
else
echo "test_resize_image_border() passed\n";
?>