* changes to the tests
[vsc.git] / _tests / models / footdoTest.php
blobca2041317734eaf044c6ab105d3d7b5a5d802967
1 <?php
2 /* Db constants
3 -----------------------*/
4 define ('DB_TYPE', 'mysql');
5 define ('DB_HOST', 'localhost');
6 define ('DB_USER', 'root');
7 define ('DB_PASS', 'ASD');
8 define ('DB_NAME', 'b');
10 usingPackage ('models/foo');
11 usingPackage ('models/sqldrivers');
12 usingPackage ('coreexceptions');
14 include_once ('dummytable.class.php'); // the definition of the entity
15 include_once ('dataobject.class.php'); // the definition of the data object
17 class fooTdoTest extends UnitTestCase {
18 public function test_Instantiation () {
19 $o = new fooTdo();
21 $this->assertIsA($o, 'fooTdoA');
24 public function testGetConnection () {
25 $o = new fooTdo ();
26 $o->setConnection (sqlFactory::connect('mysql'));
27 $this->assertIsA($o->getConnection(), 'mySqlIm');
30 public function testCreateSQL () {
31 // we should have a separate test for each type of connection
32 // the test should be the actual creation
33 $o = new dummyTable();
34 $oC = new fooTdo();
36 $createSQL = $oC->outputCreateSQL($o);
38 d (alltrim($createSQL));