array('detail' => 1, 'frames' => 1, 'images' => 1, 'video' => 1, 'misc' => 1, 'compress' => 1)); $_REQUEST = array('action' => 'export', 'eids' => array('1'), 'exportImages' => '1', 'exportFormat' => 'zip'); try { include __DIR__.'/../../web/ajax/event.php'; } catch (Done $e) { } @unlink($stubdir.'/skin/includes/export_functions.php'); @rmdir($stubdir.'/skin/includes'); @rmdir($stubdir.'/skin'); @rmdir($stubdir.'/includes'); @rmdir($stubdir); $failures = 0; function check($n, $got, $want) { global $failures; if ($got == $want) { echo "ok - $n\n"; } else { $failures++; echo "FAIL - $n (got ".var_export($got, true).")\n"; } } check('request succeeded', $out, 'ok'); check('ticked option stays on', !empty($_SESSION['export']['images']), true); foreach (array('detail', 'frames', 'video', 'misc', 'compress') as $k) check("unticked $k is cleared", !empty($_SESSION['export'][$k]), false); exit($failures ? 1 : 0);