2000-08-27 19:46:06 +00:00
|
|
|
--TEST--
|
|
|
|
InterBase: create test database
|
|
|
|
--SKIPIF--
|
|
|
|
<?php if (!extension_loaded("interbase")) print "skip"; ?>
|
|
|
|
--POST--
|
|
|
|
--GET--
|
|
|
|
--FILE--
|
|
|
|
<?
|
|
|
|
/* $Id$ */
|
|
|
|
|
2002-03-19 16:52:41 +00:00
|
|
|
// remember to give write permission to the ext/ibase/tests directory
|
|
|
|
// to the user running interbase, otherwise db creation/deletion will fail
|
|
|
|
$test_base = dirname(__FILE__)."/ibase_test.tmp";
|
2000-08-27 19:46:06 +00:00
|
|
|
$name = tempnam("","CREATEDB");
|
|
|
|
$ftmp = fopen($name,"w");
|
|
|
|
if (is_file($test_base))
|
|
|
|
fwrite($ftmp,
|
|
|
|
"connect \"$test_base\";
|
|
|
|
drop database;\n"
|
|
|
|
);
|
|
|
|
fwrite($ftmp,
|
|
|
|
"create database \"$test_base\";
|
|
|
|
create table test1 (
|
2002-03-19 16:52:41 +00:00
|
|
|
i integer,
|
|
|
|
c varchar(100)
|
|
|
|
);
|
|
|
|
commit;
|
|
|
|
insert into test1(i, c) values(1, 'test table created with isql');
|
|
|
|
exit;\n"
|
2000-08-27 19:46:06 +00:00
|
|
|
);
|
|
|
|
fclose($ftmp);
|
2002-03-19 16:52:41 +00:00
|
|
|
// passthru gives us some output, allowing the test to pass
|
|
|
|
// (actually, it passes after the first run when the db gets deleted/recreated)
|
|
|
|
passthru("isql -i $name 2>&1");
|
2000-08-27 19:46:06 +00:00
|
|
|
unlink($name);
|
|
|
|
?>
|
|
|
|
--EXPECT--
|
2002-03-19 16:52:41 +00:00
|
|
|
Use CONNECT or CREATE DATABASE to specify a database
|
|
|
|
Database: "ext/interbase/tests/ibase_test.tmp"
|