A ton of tests, figured out how to test uploads \o/

This commit is contained in:
Shish
2009-07-15 02:42:18 +01:00
parent 8dac266af4
commit c88ecebb7b
25 changed files with 250 additions and 153 deletions

View File

@ -8,7 +8,7 @@
* Some data is being uploaded. Should be caught by a file handler.
*/
class DataUploadEvent extends Event {
var $user, $tmpname, $metadata, $hash, $type;
var $user, $tmpname, $metadata, $hash, $type, $image_id = -1;
public function DataUploadEvent($user, $tmpname, $metadata) {
$this->user = $user;
@ -150,6 +150,7 @@ class Upload implements Extension {
$event = new DataUploadEvent($user, $file['tmp_name'], $metadata);
try {
send_event($event);
header("X-Shimmie-Image-ID: ".int_escape($event->image_id));
}
catch(UploadException $ex) {
$this->theme->display_upload_error($page, "Error with ".html_escape($file['name']),