| 1 |
<?php
|
| 2 |
|
| 3 |
// $Id
|
| 4 |
/**
|
| 5 |
* @file
|
| 6 |
*/
|
| 7 |
|
| 8 |
class tranformer_test extends DrupalTestCase {
|
| 9 |
function get_info() {
|
| 10 |
return array(
|
| 11 |
'name' => t('tranformer tests'),
|
| 12 |
'desc' => t('Exercises the Tranformer module'),
|
| 13 |
'group' => 'Transformer Tests'
|
| 14 |
);
|
| 15 |
}
|
| 16 |
|
| 17 |
function testTransformerScale() {
|
| 18 |
$this->drupalModuleEnable('transformer');
|
| 19 |
$src = drupal_get_path('module', 'transfomer') .'/transformer.test.jpg';
|
| 20 |
$dst = file_create_path('transformer.test.output.jpg');
|
| 21 |
|
| 22 |
//create a macro
|
| 23 |
$macro = array();
|
| 24 |
// Add a Scale to 20x20 macro.
|
| 25 |
|
| 26 |
$result = transformer_macro_perform($macro);
|
| 27 |
$info = image_get_info($dst);
|
| 28 |
$this->AssertTrue(($info['width'] == 120 && $info['height'] == 20, 'Image Scaled Properly');
|
| 29 |
unlink($dst);
|
| 30 |
}
|
| 31 |
}
|
| 32 |
|