mediatribe.net -- Drupal et développement web

Notice: this post was last updated Il y a 3 years 45 weeks so it might be outdated. Please be cautious before implementing any of suggestions herein.

Snippet of code to test image uploading in simpletests

I can't get this in my head, so here it is: how to test that a module can upload images. Add this in your Drupal Simpletest:

<?php
$image
= current($this->drupalGetTestFiles('image'));
return
drupal_realpath($image->uri);
?>