<?php
require_once ('alerter/alerter.class.php');
require_once ('dao.class.php');
require_once ('gunit/gunit.class.php');
class daoTest extends GUnit {
function testConnect(){
$o = new dao();
return $o->connect();
}
function testInsertQuery(){
$o = new dao();
$o->connect();
return $o->query("INSERT INTO `test` SET `descr` = 'adasd', `date` = 'asd'" );
}
function testSelectQuery(){
$o = new dao();
$o->connect();
return ( is_array( $o->query('SELECT * FROM `test`') ) == true ) ? true : false;
}
function testQueueSQL(){
$o = new dao();
return $o->queueSQL( 'UPDATE `test` SET `descr` = "ggg"', 'queue.sql' );
}
function testExecuteQueue(){
$o = new dao();
return $o->executeQueue( 'queue.sql' );
}
function testDeleteQuery(){
$o = new dao();
$o->connect();
return $o->query('DELETE FROM `test`');
}
}
$o = new daoTest;
$o->run();
?>
|