public/phpmyadmin/test/classes/Rte/EventsTest.php
/**
     * Data provider for testGetQueryFromRequest
     *
     * @return array
     */
Data provider for testGetQueryFromRequest
@return array
Data provider for testGetQueryFromRequest @return array
public function providerGetQueryFromRequest()
    {
        return array(
            array(
                array( 
                    'item_name'       => 's o m e e v e n t\\',
                    'item_type'       => 'ONE TIME',
                    'item_execute_at' => '2050-01-01 00:00:00',
                    'item_definition' => 'SET @A=0;'
                ),
                'CREATE EVENT `s o m e e v e n t\` ON SCHEDULE AT \'2050-01-01 ' .
                '00:00:00\' ON COMPLETION NOT PRESERVE DO SET @A=0;',
                0
            ),
            array(
                array( 
                    'item_name'       => 'evn',
                    'item_definer'    => 'me@home',
                    'item_type'       => 'ONE TIME',
                    'item_execute_at' => '2050-01-01 00:00:00',
                    'item_preserve'   => 'ON',
                    'item_status'     => 'ENABLED',
                    'item_definition' => 'SET @A=0;'
                ),
                'CREATE DEFINER=`me`@`home` EVENT `evn` ON SCHEDULE AT ' .
                '\'2050-01-01 00:00:00\' ON COMPLETION PRESERVE ENABLE DO SET @A=0;',
                0
            ),
            array(
                array( 
                    'item_name'           => 'rec_``evn',
                    'item_type'           => 'RECURRING',
                    'item_interval_value' => '365',
                    'item_interval_field' => 'DAY',
                    'item_status'         => 'DISABLED',
                    'item_definition'     => 'SET @A=0;'
                ),
                'CREATE EVENT `rec_````evn` ON SCHEDULE EVERY 365 DAY ON ' .
                'COMPLETION NOT PRESERVE DISABLE DO SET @A=0;',
                0
            ),
            array(
                array( 
                    'item_name'           => 'rec_evn2',
                    'item_definer'        => 'evil``user><\\@work\\',
                    'item_type'           => 'RECURRING',
                    'item_interval_value' => '365',
                    'item_interval_field' => 'DAY',
                    'item_starts'         => '1900-01-01',
                    'item_ends'           => '2050-01-01',
                    'item_preserve'       => 'ON',
                    'item_status'         => 'SLAVESIDE_DISABLED',
                    'item_definition'     => 'SET @A=0;'
                ),
                'CREATE DEFINER=`evil````user><\`@`work\` EVENT `rec_evn2` ON ' .
                'SCHEDULE EVERY 365 DAY STARTS \'1900-01-01\' ENDS \'2050-01-01\' ' .
                'ON COMPLETION PRESERVE DISABLE ON SLAVE DO SET @A=0;',
                0
            ),
            array(
                array( 
                ),
                'CREATE EVENT ON SCHEDULE ON COMPLETION NOT PRESERVE DO ',
                3
            ),
            array(
                array(
                    'item_name'       => 's o m e e v e n t\\',
                    'item_definer'    => 'someuser', 
                    'item_type'       => 'ONE TIME',
                    'item_execute_at' => '', 
                    'item_definition' => 'SET @A=0;'
                ),
                'CREATE EVENT `s o m e e v e n t\` ON SCHEDULE ON COMPLETION NOT ' .
                'PRESERVE DO SET @A=0;',
                2
            ),
            array(
                array(
                    'item_name'           => 'rec_``evn',
                    'item_type'           => 'RECURRING',
                    'item_interval_value' => '', 
                    'item_interval_field' => 'DAY',
                    'item_status'         => 'DISABLED',
                    'item_definition'     => 'SET @A=0;'
                ),
                'CREATE EVENT `rec_````evn` ON SCHEDULE ON COMPLETION NOT ' .
                'PRESERVE DISABLE DO SET @A=0;',
                1
            ),
            array(
                array( 
                    'item_name'           => 'rec_``evn',
                    'item_type'           => 'RECURRING',
                    'item_interval_value' => '365',
                    'item_interval_field' => 'CENTURIES', 
                    'item_status'         => 'DISABLED',
                    'item_definition'     => 'SET @A=0;'
                ),
                'CREATE EVENT `rec_````evn` ON SCHEDULE ON COMPLETION NOT ' .
                'PRESERVE DISABLE DO SET @A=0;',
                1
            ),
        );
    }
public function providerGetQueryFromRequest ( ) { return array ( array ( array ( 'item_name' => 's o m e e v e n t\\' , 'item_type' => 'ONE TIME' , 'item_execute_at' => '2050-01-01 00:00:00' , 'item_definition' => 'SET @A=0;' ) , 'CREATE EVENT `s o m e e v e n t\` ON SCHEDULE AT \'2050-01-01 ' . '00:00:00\' ON COMPLETION NOT PRESERVE DO SET @A=0;' , 0 ) , array ( array ( 'item_name' => 'evn' , 'item_definer' => 'me@home' , 'item_type' => 'ONE TIME' , 'item_execute_at' => '2050-01-01 00:00:00' , 'item_preserve' => 'ON' , 'item_status' => 'ENABLED' , 'item_definition' => 'SET @A=0;' ) , 'CREATE DEFINER=`me`@`home` EVENT `evn` ON SCHEDULE AT ' . '\'2050-01-01 00:00:00\' ON COMPLETION PRESERVE ENABLE DO SET @A=0;' , 0 ) , array ( array ( 'item_name' => 'rec_``evn' , 'item_type' => 'RECURRING' , 'item_interval_value' => '365' , 'item_interval_field' => 'DAY' , 'item_status' => 'DISABLED' , 'item_definition' => 'SET @A=0;' ) , 'CREATE EVENT `rec_````evn` ON SCHEDULE EVERY 365 DAY ON ' . 'COMPLETION NOT PRESERVE DISABLE DO SET @A=0;' , 0 ) , array ( array ( 'item_name' => 'rec_evn2' , 'item_definer' => 'evil``user><\\@work\\' , 'item_type' => 'RECURRING' , 'item_interval_value' => '365' , 'item_interval_field' => 'DAY' , 'item_starts' => '1900-01-01' , 'item_ends' => '2050-01-01' , 'item_preserve' => 'ON' , 'item_status' => 'SLAVESIDE_DISABLED' , 'item_definition' => 'SET @A=0;' ) , 'CREATE DEFINER=`evil````user><\`@`work\` EVENT `rec_evn2` ON ' . 'SCHEDULE EVERY 365 DAY STARTS \'1900-01-01\' ENDS \'2050-01-01\' ' . 'ON COMPLETION PRESERVE DISABLE ON SLAVE DO SET @A=0;' , 0 ) , array ( array ( ) , 'CREATE EVENT ON SCHEDULE ON COMPLETION NOT PRESERVE DO ' , 3 ) , array ( array ( 'item_name' => 's o m e e v e n t\\' , 'item_definer' => 'someuser' , 'item_type' => 'ONE TIME' , 'item_execute_at' => '' , 'item_definition' => 'SET @A=0;' ) , 'CREATE EVENT `s o m e e v e n t\` ON SCHEDULE ON COMPLETION NOT ' . 'PRESERVE DO SET @A=0;' , 2 ) , array ( array ( 'item_name' => 'rec_``evn' , 'item_type' => 'RECURRING' , 'item_interval_value' => '' , 'item_interval_field' => 'DAY' , 'item_status' => 'DISABLED' , 'item_definition' => 'SET @A=0;' ) , 'CREATE EVENT `rec_````evn` ON SCHEDULE ON COMPLETION NOT ' . 'PRESERVE DISABLE DO SET @A=0;' , 1 ) , array ( array ( 'item_name' => 'rec_``evn' , 'item_type' => 'RECURRING' , 'item_interval_value' => '365' , 'item_interval_field' => 'CENTURIES' , 'item_status' => 'DISABLED' , 'item_definition' => 'SET @A=0;' ) , 'CREATE EVENT `rec_````evn` ON SCHEDULE ON COMPLETION NOT ' . 'PRESERVE DISABLE DO SET @A=0;' , 1 ) , ) ; }
Data provider for testGetQueryFromRequest
 @return array
Data provider for testGetQueryFromRequest @return array
// Testing success // simple once-off event // full once-off event // simple recurring event // full recurring event // Testing failures // empty request // invalid definer format // no execution time // no interval value // simple recurring event // invalid interval field