Skip to content

Commit

Permalink
MFH
Browse files Browse the repository at this point in the history
  • Loading branch information
foobar committed Apr 25, 2003
1 parent 7756f1b commit 56fa94a
Show file tree
Hide file tree
Showing 8 changed files with 50 additions and 76 deletions.
39 changes: 0 additions & 39 deletions ext/interbase/tests/001.phpt

This file was deleted.

7 changes: 3 additions & 4 deletions ext/interbase/tests/002.phpt
@@ -1,14 +1,13 @@
--TEST--
InterBase: connect, close and pconnect
--SKIPIF--
<?php if (!extension_loaded("interbase")) print "skip"; ?>
<?php include("skipif.inc"); ?>
--POST--
--GET--
--FILE--
<?
/* $Id$ */
<?php /* $Id$ */

require(dirname(__FILE__)."/interbase.inc");
require("interbase.inc");

$test_base = dirname(__FILE__)."/ibase_test.tmp";

Expand Down
16 changes: 5 additions & 11 deletions ext/interbase/tests/003.phpt
@@ -1,16 +1,13 @@
--TEST--
InterBase: misc sql types (may take a while)
--SKIPIF--
<?php if (!extension_loaded("interbase")) print "skip"; ?>
<?php include("skipif.inc"); ?>
--POST--
--GET--
--FILE--
<?
/* $Id$ */
<?php

require(dirname(__FILE__)."/interbase.inc");

$test_base = dirname(__FILE__)."/ibase_test.tmp";
require("interbase.inc");

ibase_connect($test_base);

Expand All @@ -29,7 +26,7 @@ InterBase: misc sql types (may take a while)
)");
ibase_commit();

/* if timefmt is not supported, suppress error here*/
/* if timefmt is not supported, suppress error here */
@ibase_timefmt("%m/%d/%Y %H:%M:%S");

for($iter = 0; $iter < 10; $iter++){
Expand Down Expand Up @@ -81,13 +78,10 @@ InterBase: misc sql types (may take a while)
echo " out: $row->V_INTEGER\n";
}
ibase_free_result($sel);
}/* for($iter)*/
} /* for($iter) */

ibase_close();
echo "end of test\n";
?>
--EXPECT--

end of test


13 changes: 6 additions & 7 deletions ext/interbase/tests/004.phpt
@@ -1,16 +1,13 @@
--TEST--
InterBase: BLOB test
--SKIPIF--
<?php if (!extension_loaded("interbase")) print "skip"; ?>
<?php include("skipif.inc"); ?>
--POST--
--GET--
--FILE--
<?
/* $Id$ */
<?php

require(dirname(__FILE__)."/interbase.inc");

$test_base = dirname(__FILE__)."/ibase_test.tmp";
require("interbase.inc");

ibase_connect($test_base);

Expand Down Expand Up @@ -38,7 +35,8 @@ InterBase: BLOB test
$q = ibase_query("select v_blob from test4 where v_integer = 1");
$row = ibase_fetch_object($q);
$bl_h = ibase_blob_open($row->V_BLOB);


$blob = '';
while($piece = ibase_blob_get($bl_h, rand() % 1024))
$blob .= $piece;
if($blob != $blob_str)
Expand All @@ -63,6 +61,7 @@ InterBase: BLOB test
$q = ibase_query("select v_blob from test4 where v_integer = 2");
$row = ibase_fetch_object($q);
$bl_h = ibase_blob_open($row->V_BLOB);
$blob = '';
while($piece = ibase_blob_get($bl_h, rand() % 1024))
$blob .= $piece;
if($blob != $blob_str)
Expand Down
9 changes: 3 additions & 6 deletions ext/interbase/tests/005.phpt
@@ -1,16 +1,13 @@
--TEST--
InterBase: transactions
--SKIPIF--
<?php if (!extension_loaded("interbase")) print "skip"; ?>
<?php include("skipif.inc"); ?>
--POST--
--GET--
--FILE--
<?
/* $Id$ */
<?php

require(dirname(__FILE__)."/interbase.inc");

$test_base = dirname(__FILE__)."/ibase_test.tmp";
require("interbase.inc");

ibase_connect($test_base);

Expand Down
9 changes: 3 additions & 6 deletions ext/interbase/tests/006.phpt
@@ -1,16 +1,13 @@
--TEST--
InterBase: binding (may take a while)
--SKIPIF--
<?php if (!extension_loaded("interbase")) print "skip"; ?>
<?php include("skipif.inc"); ?>
--POST--
--GET--
--FILE--
<?
/* $Id$ */
<?php

require(dirname(__FILE__)."/interbase.inc");

$test_base = dirname(__FILE__)."/ibase_test.tmp";
require("interbase.inc");

ibase_connect($test_base);

Expand Down
1 change: 0 additions & 1 deletion ext/interbase/tests/extension

This file was deleted.

32 changes: 30 additions & 2 deletions ext/interbase/tests/interbase.inc
@@ -1,9 +1,37 @@
<?
<?php

/* $Id$ */
/* used in tests */

srand((double)microtime()*1000000);

$test_base = dirname(__FILE__)."/ibase_test.tmp";
@unlink($test_base);

$name = dirname(__FILE__).tempnam("","CREATEDB");
$ftmp = fopen($name,"w");
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;
"
);
fclose($ftmp);

/* set the correct binary */
if (is_executable('isql')) {
$cmd = 'isql';
} else {
$cmd = '/opt/interbase/bin/isql';
}

exec("$cmd -i $name 2>&1");
@unlink($name);


function out_table($table_name)
{
echo "--- $table_name ---\n";
Expand Down Expand Up @@ -74,4 +102,4 @@ function rand_number($len , $prec = -1, $sign = 1)
return $n;
}

?>
?>

0 comments on commit 56fa94a

Please sign in to comment.