/** * Test for PMA_EVN_getQueryFromRequest * * @param array $request Request * @param string $query Query * @param array $num_err Error number * * @return void * * @dataProvider provider */ public function testgetQueryFromRequest($request, $query, $num_err) { global $_REQUEST, $errors; $errors = array(); PMA_EVN_setGlobals(); unset($_REQUEST); $_REQUEST = $request; $this->assertEquals($query, PMA_EVN_getQueryFromRequest()); $this->assertEquals($num_err, count($errors)); }
/** * Test for PMA_EVN_getQueryFromRequest * * @param array $request Request * @param string $query Query * @param array $num_err Error number * * @return void * * @dataProvider provider */ public function testgetQueryFromRequest($request, $query, $num_err) { global $_REQUEST, $errors; $errors = array(); PMA_EVN_setGlobals(); unset($_REQUEST); $_REQUEST = $request; $dbi = $this->getMockBuilder('PMA\\libraries\\DatabaseInterface')->disableOriginalConstructor()->getMock(); $dbi->expects($this->any())->method('escapeString')->will($this->returnArgument(0)); $GLOBALS['dbi'] = $dbi; $this->assertEquals($query, PMA_EVN_getQueryFromRequest()); $this->assertEquals($num_err, count($errors)); }
/** * Main function for the events functionality * * @return void */ function PMA_EVN_main() { global $db; PMA_EVN_setGlobals(); /** * Process all requests */ PMA_EVN_handleEditor(); PMA_EVN_handleExport(); /** * Display a list of available events */ $items = $GLOBALS['dbi']->getEvents($db); echo PMA_RTE_getList('event', $items); /** * Display a link for adding a new event, if * the user has the privileges and a link to * toggle the state of the event scheduler. */ echo PMA_EVN_getFooterLinks(); }
/** * Main function for the events functionality */ function PMA_EVN_main() { global $db; PMA_EVN_setGlobals(); /** * Process all requests */ PMA_EVN_handleEditor(); PMA_EVN_handleExport(); /** * Display a list of available events */ $columns = "`EVENT_NAME`, `EVENT_TYPE`, `STATUS`"; $where = "EVENT_SCHEMA='" . PMA_sqlAddSlashes($db) . "'"; $query = "SELECT {$columns} FROM `INFORMATION_SCHEMA`.`EVENTS` " . "WHERE {$where} ORDER BY `EVENT_NAME` ASC;"; $items = PMA_DBI_fetch_result($query); echo PMA_RTE_getList('event', $items); /** * Display a link for adding a new event, if * the user has the privileges and a link to * toggle the state of the event scheduler. */ echo PMA_EVN_getFooterLinks(); }
/** * Test for PMA_EVN_getEditorForm * * @param array $data Data for routine * @param array $matcher Matcher * * @return void * * @dataProvider provider_ajax */ public function testgetEditorForm_ajax($data, $matcher) { $GLOBALS['is_ajax_request'] = true; PMA_EVN_setGlobals(); $this->assertTag($matcher, PMA_EVN_getEditorForm('edit', 'change', $data), '', false); }
/** * Test for PMA_EVN_getEditorForm * * @param array $data Data for routine * @param array $matcher Matcher * * @return void * * @dataProvider providerAjax */ public function testgetEditorFormAjax($data, $matcher) { Response::getInstance()->setAjax(true); PMA_EVN_setGlobals(); $this->assertContains( $matcher, PMA_EVN_getEditorForm('edit', 'change', $data) ); Response::getInstance()->setAjax(false); }