'7'), $req); $view = 'video'; $rates = array(); $scales = array(); $skin = 'classic'; ob_start(); try { include __DIR__.'/../../web/skins/classic/views/video.php'; } catch (Throwable $e) { ob_end_clean(); $GLOBALS['dlResult'] = 'threw: '.$e->getMessage(); return 'threw: '.$e->getMessage(); } ob_end_clean(); return 'ok'; } check('showIndex past the end does not throw', view(array('showIndex' => '5')), 'ok'); check('fractional scale sizes the player', view(array('showIndex' => '0')).' '.$size, 'ok 320x240'); // downloadIndex ends in exit, so its result is checked at shutdown register_shutdown_function(function () { global $failures, $dlResult; check('downloadIndex past the end warns and does not throw', $dlResult.' '.count($GLOBALS['warnings']), 'pending 1'); exit($failures ? 1 : 0); }); $dlResult = 'pending'; view(array('downloadIndex' => '5')); }