123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138 |
- <?php
- function image_test_image_toolkits() {
- return array(
- 'test' => array(
- 'title' => t('A dummy toolkit that works'),
- 'available' => TRUE,
- ),
- 'broken' => array(
- 'title' => t('A dummy toolkit that is "broken"'),
- 'available' => FALSE,
- ),
- );
- }
- function image_test_reset() {
-
- $results = array(
- 'load' => array(),
- 'save' => array(),
- 'settings' => array(),
- 'resize' => array(),
- 'rotate' => array(),
- 'crop' => array(),
- 'desaturate' => array(),
- );
- variable_set('image_test_results', $results);
- }
- function image_test_get_all_calls() {
- return variable_get('image_test_results', array());
- }
- function _image_test_log_call($op, $args) {
- $results = variable_get('image_test_results', array());
- $results[$op][] = $args;
- variable_set('image_test_results', $results);
- }
- function image_test_settings() {
- _image_test_log_call('settings', array());
- return array();
- }
- function image_test_get_info(stdClass $image) {
- _image_test_log_call('get_info', array($image));
- return array();
- }
- function image_test_load(stdClass $image) {
- _image_test_log_call('load', array($image));
- return $image;
- }
- function image_test_save(stdClass $image, $destination) {
- _image_test_log_call('save', array($image, $destination));
-
-
- return FALSE;
- }
- function image_test_crop(stdClass $image, $x, $y, $width, $height) {
- _image_test_log_call('crop', array($image, $x, $y, $width, $height));
- return TRUE;
- }
- function image_test_resize(stdClass $image, $width, $height) {
- _image_test_log_call('resize', array($image, $width, $height));
- return TRUE;
- }
- function image_test_rotate(stdClass $image, $degrees, $background = NULL) {
- _image_test_log_call('rotate', array($image, $degrees, $background));
- return TRUE;
- }
- function image_test_desaturate(stdClass $image) {
- _image_test_log_call('desaturate', array($image));
- return TRUE;
- }
|