diff options
author | Ludovico Magnocavallo <ludoo@php.net> | 2002-03-19 16:52:41 +0000 |
---|---|---|
committer | Ludovico Magnocavallo <ludoo@php.net> | 2002-03-19 16:52:41 +0000 |
commit | 6ebf422685f754aba884b77a002669a5c2e5d3a0 (patch) | |
tree | b46feab173de7fd5dbe556c4266d7635ae7e9bc9 | |
parent | c3daa1816899f5a5cf8dd632dfe1bb2873e7ac21 (diff) | |
download | php-git-6ebf422685f754aba884b77a002669a5c2e5d3a0.tar.gz |
Fixed include of interbase.inc
Fixed test database path
Changed v_date field in test table definition to timestamp type
Reduced maximum length of double precision type to 18
Tests 001 002 003 006 pass
Test 004 (BLOB test) still needs to be fixed
Test 005 (Transaction) gives the right output but issues a warning
-rw-r--r-- | ext/interbase/tests/001.phpt | 23 | ||||
-rw-r--r-- | ext/interbase/tests/002.phpt | 4 | ||||
-rw-r--r-- | ext/interbase/tests/003.phpt | 10 | ||||
-rw-r--r-- | ext/interbase/tests/004.phpt | 4 | ||||
-rw-r--r-- | ext/interbase/tests/005.phpt | 11 | ||||
-rw-r--r-- | ext/interbase/tests/006.phpt | 6 |
6 files changed, 31 insertions, 27 deletions
diff --git a/ext/interbase/tests/001.phpt b/ext/interbase/tests/001.phpt index 79263d6f5c..6d221d04c0 100644 --- a/ext/interbase/tests/001.phpt +++ b/ext/interbase/tests/001.phpt @@ -8,7 +8,9 @@ InterBase: create test database <? /* $Id$ */ - $test_base = "ibase_test.tmp"; + // 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"; $name = tempnam("","CREATEDB"); $ftmp = fopen($name,"w"); if (is_file($test_base)) @@ -19,16 +21,19 @@ InterBase: create test database fwrite($ftmp, "create database \"$test_base\"; create table test1 ( - i integer, - c varchar(100) - ); - commit; - insert into test1(i, c) values(1, 'test table created with isql'); - exit;\n" + i integer, + c varchar(100) + ); + commit; + insert into test1(i, c) values(1, 'test table created with isql'); + exit;\n" ); fclose($ftmp); - exec("isql -i $name 2>&1"); + // 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"); unlink($name); ?> --EXPECT-- - +Use CONNECT or CREATE DATABASE to specify a database +Database: "ext/interbase/tests/ibase_test.tmp" diff --git a/ext/interbase/tests/002.phpt b/ext/interbase/tests/002.phpt index 6ea1b498ba..d240e82e81 100644 --- a/ext/interbase/tests/002.phpt +++ b/ext/interbase/tests/002.phpt @@ -8,9 +8,9 @@ InterBase: connect, close and pconnect <? /* $Id$ */ - require("interbase/interbase.inc"); + require(dirname(__FILE__)."/interbase.inc"); - $test_base = "ibase_test.tmp"; + $test_base = dirname(__FILE__)."/ibase_test.tmp"; ibase_connect($test_base); out_table("test1"); diff --git a/ext/interbase/tests/003.phpt b/ext/interbase/tests/003.phpt index 5398b52850..4afee04cad 100644 --- a/ext/interbase/tests/003.phpt +++ b/ext/interbase/tests/003.phpt @@ -8,9 +8,9 @@ InterBase: misc sql types (may take a while) <? /* $Id$ */ - require("interbase/interbase.inc"); + require(dirname(__FILE__)."/interbase.inc"); - $test_base = "ibase_test.tmp"; + $test_base = dirname(__FILE__)."/ibase_test.tmp"; ibase_connect($test_base); @@ -18,7 +18,7 @@ InterBase: misc sql types (may take a while) "create table test3 ( iter integer, v_char char(1000), - v_date date, + v_date timestamp, v_decimal decimal(12,3), v_double double precision, v_float float, @@ -37,7 +37,7 @@ InterBase: misc sql types (may take a while) $v_char = rand_str(1000); $v_date = rand_datetime(); $v_decimal = rand_number(12,3); - $v_double = rand_number(20); + $v_double = rand_number(18); $v_float = rand_number(7); $v_integer = rand_number(9,0); $v_numeric = rand_number(4,2); @@ -48,7 +48,7 @@ InterBase: misc sql types (may take a while) "insert into test3 (iter, v_char,v_date,v_decimal,v_double,v_float,v_integer,v_numeric,v_smallint,v_varchar) values ($iter, '$v_char','$v_date',$v_decimal,$v_double,$v_float,$v_integer,$v_numeric,$v_smallint,'$v_varchar')"); $sel = ibase_query("select * from test3 where iter = $iter"); - + $sel = ibase_query("select * from test3 where iter = $iter"); $row = ibase_fetch_object($sel); if(substr($row->V_CHAR,0,strlen($v_char)) != $v_char){ echo " CHAR fail:\n"; diff --git a/ext/interbase/tests/004.phpt b/ext/interbase/tests/004.phpt index 04df7ae991..01e18e1a50 100644 --- a/ext/interbase/tests/004.phpt +++ b/ext/interbase/tests/004.phpt @@ -8,9 +8,9 @@ InterBase: BLOB test <? /* $Id$ */ - require("interbase/interbase.inc"); + require(dirname(__FILE__)."/interbase.inc"); - $test_base = "ibase_test.tmp"; + $test_base = dirname(__FILE__)."/ibase_test.tmp"; ibase_connect($test_base); diff --git a/ext/interbase/tests/005.phpt b/ext/interbase/tests/005.phpt index 5cf77667e0..43b60d8bb0 100644 --- a/ext/interbase/tests/005.phpt +++ b/ext/interbase/tests/005.phpt @@ -8,9 +8,9 @@ InterBase: transactions <? /* $Id$ */ - require("interbase/interbase.inc"); + require(dirname(__FILE__)."/interbase.inc"); - $test_base = "ibase_test.tmp"; + $test_base = dirname(__FILE__)."/ibase_test.tmp"; ibase_connect($test_base); @@ -111,7 +111,7 @@ three transaction on default link $tr_1 = ibase_trans(); /* this default transaction also */ $tr_2 = ibase_trans(IBASE_READ); - $tr_3 = ibase_trans(IBASE_READ+IBASE_COMMITED); + $tr_3 = ibase_trans(IBASE_READ+IBASE_COMMITTED); $res = ibase_query("select * from test5"); @@ -157,15 +157,14 @@ three transaction on default link ibase_free_result($res); ibase_close(); - /* transactions on second link */ $link_1 = ibase_pconnect($test_base); $link_2 = ibase_pconnect($test_base); - $tr_1 = ibase_trans($link_2, IBASE_DEFAULT); /* this default transaction also */ - $tr_2 = ibase_trans($link_2, IBASE_COMMITED); + $tr_1 = ibase_trans(IBASE_DEFAULT, $link_2); /* this default transaction also */ + $tr_2 = ibase_trans(IBASE_COMMITTED, $link_2); $res = ibase_query($tr_1, "select * from test5"); diff --git a/ext/interbase/tests/006.phpt b/ext/interbase/tests/006.phpt index bad07e3315..2472a2ac2f 100644 --- a/ext/interbase/tests/006.phpt +++ b/ext/interbase/tests/006.phpt @@ -8,9 +8,9 @@ InterBase: binding (may take a while) <? /* $Id$ */ - require("interbase/interbase.inc"); + require(dirname(__FILE__)."/interbase.inc"); - $test_base = "ibase_test.tmp"; + $test_base = dirname(__FILE__)."/ibase_test.tmp"; ibase_connect($test_base); @@ -18,7 +18,7 @@ InterBase: binding (may take a while) "create table test6 ( iter integer, v_char char(1000), - v_date date, + v_date timestamp, v_decimal decimal(12,3), v_double double precision, v_float float, |