'999'); ob_start(); $result = include $modalFile; $html = ob_get_clean(); check('missing monitor row raises no PHP warning', count($phpErrors) === 0); if (count($phpErrors)) { foreach ($phpErrors as $err) echo " php: $err\n"; } check('missing monitor row returns blank string', $result === ' '); check('missing monitor row logs a ZM\Warning', count($GLOBALS['zmWarnings']) > 0); check('missing monitor row renders no modal', strpos($html, 'ctrlPresetModal') === false); // (b) No mid in the request at all. $phpErrors = array(); $GLOBALS['zmWarnings'] = array(); $_REQUEST = array(); ob_start(); $result = include $modalFile; $html = ob_get_clean(); check('absent mid raises no PHP warning', count($phpErrors) === 0); if (count($phpErrors)) { foreach ($phpErrors as $err) echo " php: $err\n"; } check('absent mid returns blank string', $result === ' '); check('absent mid logs a ZM\Warning', count($GLOBALS['zmWarnings']) > 0); echo "\n$tests tests, $failures failures\n"; exit($failures ? 1 : 0); } namespace ZM { function Warning($message) { $GLOBALS['zmWarnings'][] = $message; } }