Annotation of embedaddon/php/ext/pdo_firebird/tests/testdb.inc, revision 1.1.1.2
1.1.1.2 ! misho 1: <?php /* $Id$ */
1.1 misho 2:
3: $user = 'SYSDBA';
4: $password = 'masterkey';
5: ini_set('ibase.default_user',$user);
6: ini_set('ibase.default_password',$password);
7:
8: /* we need just the generated name, not the file itself */
9: unlink($test_base = tempnam('/tmp',"php_ibase_test"));
10:
11: function init_db()
12: {
13: global $test_base, $user, $password;
14:
15: $test_db = ibase_query(IBASE_CREATE,sprintf("CREATE DATABASE '%s' USER '%s' PASSWORD '%s'",
16: $test_base, $user, $password));
17: $tr = ibase_trans($test_db);
18: ibase_query($tr,"create table test1 (i integer, c varchar(100))");
19: ibase_commit_ret($tr);
20: ibase_query($tr,"insert into test1(i, c) values(1, 'test table not created with isql')");
21: ibase_commit($tr);
22: ibase_close($test_db);
23: }
24:
25: function cleanup_db()
26: {
27: global $test_base;
28:
29: $r = ibase_connect($test_base);
30: ibase_drop_db($r);
31: }
32:
33: register_shutdown_function('cleanup_db');
34: init_db();
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>