PHP Classes

File: dao.test.php

Recommend this page to a friend!
  Classes of Georgi Momchilov   DAO   ???   Download  
File: ???
Role: Unit test script
Content type: text/plain
Description: test file - uses gUnit to test
Class: DAO
Database access wrapper providing query queueing
Author: By
Last change: Important bug fixes
Date: 18 years ago
Size: 1,069 bytes
 

Contents

Class file image Download
<?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();
?>