View source
<?php
class FilterIEImageEffectsUnitTest extends ImageToolkitTestCase {
public static function getInfo() {
return array(
'name' => 'FiltersIE Image effects',
'description' => 'Test that the image effects pass parameters to the toolkit correctly.',
'group' => 'Image',
);
}
function setUp() {
parent::setUp('image_module_test');
module_load_include('module', 'filtersie');
}
function testfiltersie_UnsharpMaskEffect() {
$this
->assertTrue(filtersie_sharpenUSM_effect($this->image, array(
'amount' => 50,
'radius' => 1,
'threshold' => 3,
)), 'filtersie_UnsharpMask Function returned the expected value.');
$this
->assertToolkitOperationsCalled(array(
'filtersie_UnsharpMask',
));
$calls = image_test_get_all_calls();
$this
->assertEqual($calls['filtersie_UnsharpMask'][0][1], 50, 'Amount was passed correctly');
$this
->assertEqual($calls['filtersie_UnsharpMask'][0][2], 1, 'Radius was passed correctly');
$this
->assertEqual($calls['filtersie_UnsharpMask'][0][3], 3, 'Threshold was passed correctly');
$this
->assertEqual($calls['filtersie_UnsharpMask'][0][4], NULL, 'Sigma was passed correctly');
$this
->assertTrue(filtersie_sharpenUSM_effect($this->image, array(
'amount' => 50,
'radius' => 1,
'threshold' => 3,
'sigma' => 4,
)), 'filtersie_UnsharpMask Function returned the expected value.');
$this
->assertToolkitOperationsCalled(array(
'filtersie_UnsharpMask',
));
$calls = image_test_get_all_calls();
$this
->assertEqual($calls['filtersie_UnsharpMask'][1][1], 50, 'Amount was passed correctly');
$this
->assertEqual($calls['filtersie_UnsharpMask'][1][2], 1, 'Radius was passed correctly');
$this
->assertEqual($calls['filtersie_UnsharpMask'][1][3], 3, 'Threshold was passed correctly');
$this
->assertEqual($calls['filtersie_UnsharpMask'][1][4], 4, 'Sigma was passed correctly');
}
}
function image_test_filtersie_UnsharpMask(stdClass $image, $amount, $radius, $threshold, $sigma) {
_image_test_log_call('filtersie_UnsharpMask', array(
$image,
$amount,
$radius,
$threshold,
$sigma,
));
return TRUE;
}