cvs: pear /MDB2/tests test_setup.php.dist

From: Date: Sat, 02 Sep 2006 05:38:27 +0000
Subject: cvs: pear /MDB2/tests test_setup.php.dist
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-41949@lists.php.net to get a copy of this message
lsmith Sat Sep 2 05:38:27 2006 UTC Modified files: /pear/MDB2/tests test_setup.php.dist Log: - simplified example code for creating databases (untested) http://cvs.php.net/viewvc.cgi/pear/MDB2/tests/test_setup.php.dist?r1=1.16&r2=1.17&diff_format=u Index: pear/MDB2/tests/test_setup.php.dist diff -u pear/MDB2/tests/test_setup.php.dist:1.16 pear/MDB2/tests/test_setup.php.dist:1.17 --- pear/MDB2/tests/test_setup.php.dist:1.16 Sat Sep 2 03:10:24 2006 +++ pear/MDB2/tests/test_setup.php.dist Sat Sep 2 05:38:27 2006 @@ -101,43 +101,34 @@ #$dbarray[] = $fbsql; #$dbarray[] = $ibase; +// you may need to uncomment the line and modify the multiplier as you see fit +#set_time_limit(60*count($dbarray)); + //if uncommented, the following will drop and recreate the test database when running the test // the paths assumes that MDB2_Schema is checked out in the same parent directory as MDB2 /* require_once('MDB2/Schema.php'); +$schema_path = '../../MDB2_Schema/tests/'; + function pe($e) { die($e->getMessage().' '.$e->getUserInfo()); } PEAR::pushErrorHandling(PEAR_ERROR_CALLBACK, 'pe'); foreach ($dbarray as $dbtype) { - $dsn = $dbtype['dsn']; - if ($dbtype['dsn']['phptype'] == 'oci8') { - $dsn['username'] = $dbtype['options']['DBA_username']; - $dsn['password'] = $dbtype['options']['DBA_password']; - $dsn['database'] = $dbtype['options']['DBA_username']; - } - $db =& MDB2::connect($dsn, $dbtype['options']); - $db->loadModule('Manager'); - $db->manager->dropDatabase('driver_test'); - if ($dbtype['dsn']['phptype'] == 'oci8') { - $db->query('CREATE USER '.$dbtype['dsn']['username'].' IDENTIFIED BY '.$dbtype['dsn']['password'].' DEFAULT TABLESPACE USERS QUOTA UNLIMITED ON USERS'); - $db->query('GRANT CREATE SESSION, CREATE TABLE, CREATE SEQUENCE, CREATE TRIGGER to '.$dbtype['dsn']['username']); - } $schema =& MDB2_Schema::factory($dbtype['dsn'], $dbtype['options']); + $schema->db->manager->dropDatabase('driver_test'); $schema->updateDatabase( - '../../MDB2_Schema/tests/driver_test.schema', - false, - array('create' => '1', 'name' => 'driver_test') - ); + $schema_path.'driver_test.schema', + false, + array('create' => '1', 'name' => 'driver_test') + ); $schema->updateDatabase( - '../../MDB2_Schema/tests/lob_test.schema', - false, - array('create' => '1', 'name' => 'driver_test') - ); + $schema_path.'lob_test.schema', + false, + array('create' => '1', 'name' => 'driver_test') + ); } PEAR::popErrorHandling(); */ -// you may need to uncomment the line and modify the multiplier as you see fit -#set_time_limit(60*count($dbarray)); ?>

« previous php.pear.cvs (#41949) next »