Exemplo n.º 1
0
 function test()
 {
     Tap::is_instance_of('db successfully initializes', 'Db', 'getDao', 'mysqli', NULL);
     // $all_tables = array('Classes', 'Professors', 'Student_classes', 'Students');
     // Tap::is('read existing tables', 'Db', 'getAllTables', $all_tables, NULL);
     // $no_tables = array('status' => false);
     $table_name = 'taptest_table_' . Util::randString(10, 'lowercase');
     $creation_statement = 'CREATE TABLE `' . $table_name . '` ( `id` int(10) NOT NULL auto_increment, `test_str` varchar(128) NOT NULL, PRIMARY KEY (`id`)) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=2;';
     Tap::is('create new table', 'Db', 'createTable', '1', $creation_statement);
     $all_tables[] = $table_name;
     Tap::is('read existing tables', 'Db', 'getAllTables', $all_tables, NULL);
     array_pop($all_tables);
     //create row
     array('');
     //Tap::is('add a new row', 'Db', 'add', '', );
     //read row
     //update row
     //read row
     //delete row
     //read row
     Tap::is('drop the random table created', 'Db', 'dropTable', $all_tables, $table_name);
     Tap::is('read existing tables', 'Db', 'getAllTables', NULL, '');
 }