Merge branch 'PHP-7.4'

* PHP-7.4:
  Replace dirname(__FILE__) by __DIR__ in tests
This commit is contained in:
Peter Kokot 2019-03-15 23:36:47 +01:00
commit 6426420f61
2816 changed files with 5578 additions and 5578 deletions

View file

@ -5,13 +5,13 @@ get_included_files() tests
var_dump(get_included_files());
include(dirname(__FILE__)."/014.inc");
include(__DIR__."/014.inc");
var_dump(get_included_files());
include_once(dirname(__FILE__)."/014.inc");
include_once(__DIR__."/014.inc");
var_dump(get_included_files());
include(dirname(__FILE__)."/014.inc");
include(__DIR__."/014.inc");
var_dump(get_included_files());
echo "Done\n";

View file

@ -151,7 +151,7 @@ foreach ($array_variables as $array_var) {
echo "\n*** Testing unset(), empty() & isset() with resource variables ***\n";
$fp = fopen(__FILE__, "r");
$dfp = opendir( dirname(__FILE__) );
$dfp = opendir( __DIR__ );
$resources = array (
$fp,
$dfp

View file

@ -15,7 +15,7 @@ class debugfilter extends php_user_filter {
stream_filter_register("myfilter","debugfilter");
$fp = fopen(dirname(__FILE__)."/test.txt","w");
$fp = fopen(__DIR__."/test.txt","w");
stream_filter_append($fp, "myfilter");
stream_filter_append($fp, "myfilter");
stream_filter_append($fp, "myfilter");
@ -24,8 +24,8 @@ print "Done.\n";
fclose($fp);
// Uncommenting the following 'print' line causes the segfault to stop occurring
// print "2\n";
readfile(dirname(__FILE__)."/test.txt");
unlink(dirname(__FILE__)."/test.txt");
readfile(__DIR__."/test.txt");
unlink(__DIR__."/test.txt");
?>
--EXPECT--
Done.

View file

@ -23,14 +23,14 @@ class Loader {
var_dump("flush!");
}
function stream_close() {
@unlink(dirname(__FILE__)."/bug38779.txt");
@unlink(__DIR__."/bug38779.txt");
var_dump("close!");
}
}
stream_wrapper_register('Loader', 'Loader');
$fp = fopen ('Loader://qqq.php', 'r');
$filename = dirname(__FILE__)."/bug38779.txt";
$filename = __DIR__."/bug38779.txt";
$fp1 = fopen($filename, "w");
fwrite($fp1, "<"."?php blah blah?".">");
fclose($fp1);
@ -42,9 +42,9 @@ echo "Done\n";
--CLEAN--
<?php
$filename = dirname(__FILE__)."/bug38779.txt";
$filename = __DIR__."/bug38779.txt";
if (file_exists($filename)) {
@unlink(dirname(__FILE__)."/bug38779.txt");
@unlink(__DIR__."/bug38779.txt");
}
?>
--EXPECTF--

View file

@ -3,11 +3,11 @@ Bug #39542 (Behaviour of require_once/include_once different to < 5.2.0)
--FILE--
<?php
$oldcwd = getcwd();
chdir(dirname(__FILE__));
chdir(__DIR__);
if (substr(PHP_OS, 0, 3) == 'WIN') {
set_include_path(dirname(__FILE__).'/bug39542;.');
set_include_path(__DIR__.'/bug39542;.');
} else {
set_include_path(dirname(__FILE__).'/bug39542:.');
set_include_path(__DIR__.'/bug39542:.');
}
spl_autoload_register(function ($class) {

View file

@ -7,7 +7,7 @@ if (extension_loaded("readline")) die("skip Test doesn't support readline");
--FILE--
<?php
$php = getenv('TEST_PHP_EXECUTABLE');
$cmd = "\"$php\" -n -d memory_limit=4M -a \"".dirname(__FILE__)."\"/bug40236.inc";
$cmd = "\"$php\" -n -d memory_limit=4M -a \"".__DIR__."\"/bug40236.inc";
echo `$cmd`;
?>
--EXPECTF--

View file

@ -3,7 +3,7 @@ Bug #52508 (newline problem with parse_ini_file+INI_SCANNER_RAW)
--FILE--
<?php
$file = dirname(__FILE__) .'/bug52508.ini';
$file = __DIR__ .'/bug52508.ini';
file_put_contents($file, "a = 1");

View file

@ -2,7 +2,7 @@
Bug #63741 (Crash when autoloading from spl)
--FILE--
<?php
file_put_contents(dirname(__FILE__)."/bug63741.tmp.php",
file_put_contents(__DIR__."/bug63741.tmp.php",
<<<'EOT'
<?php
if (isset($autoloading))
@ -41,10 +41,10 @@ else
EOT
);
include dirname(__FILE__)."/bug63741.tmp.php";
include __DIR__."/bug63741.tmp.php";
?>
--CLEAN--
<?php unlink(dirname(__FILE__)."/bug63741.tmp.php"); ?>
<?php unlink(__DIR__."/bug63741.tmp.php"); ?>
--EXPECT--
autoloading...
OK!

View file

@ -11,7 +11,7 @@ class test {
?>
DATA;
$filename = dirname(__FILE__)."/cc003.dat";
$filename = __DIR__."/cc003.dat";
file_put_contents($filename, $class_data);
function foo($v = test::val) {

View file

@ -6,7 +6,7 @@ variables_order="egpcs"
<?php
function test() {
include dirname(__FILE__)."/globals.inc";
include __DIR__."/globals.inc";
}
test();

View file

@ -4,18 +4,18 @@ __HALT_COMPILER(); 2 files
<?php
$text = "<?php echo 'test'; var_dump(__COMPILER_HALT_OFFSET__); __HALT_COMPILER(); ?>
hi there";
file_put_contents(dirname(__FILE__) . '/test1.php', $text);
file_put_contents(__DIR__ . '/test1.php', $text);
$text = "<?php echo 'test2'; var_dump(__COMPILER_HALT_OFFSET__); __HALT_COMPILER(); ?>
hi there 2";
file_put_contents(dirname(__FILE__) . '/test2.php', $text);
include dirname(__FILE__) . '/test1.php';
include dirname(__FILE__) . '/test2.php';
file_put_contents(__DIR__ . '/test2.php', $text);
include __DIR__ . '/test1.php';
include __DIR__ . '/test2.php';
?>
==DONE==
--CLEAN--
<?php
unlink(dirname(__FILE__) . '/test1.php');
unlink(dirname(__FILE__) . '/test2.php');
unlink(__DIR__ . '/test1.php');
unlink(__DIR__ . '/test2.php');
?>
--EXPECT--
testint(73)

View file

@ -122,7 +122,7 @@ function prepareLine($op1, $op2, $cmp, $operator) {
return $line;
}
$filename = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'compare_binary_operands_temp.php';
$filename = __DIR__ . DIRECTORY_SEPARATOR . 'compare_binary_operands_temp.php';
$file = fopen($filename, "w");
fwrite($file, "<?php\n");
@ -148,7 +148,7 @@ if($c === 0) {
===DONE===
--CLEAN--
<?php
$fl = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'compare_binary_operands_temp.php';
$fl = __DIR__ . DIRECTORY_SEPARATOR . 'compare_binary_operands_temp.php';
@unlink($fl);
?>
--EXPECT--

View file

@ -6,7 +6,7 @@ session.save_handler=files
--SKIPIF--
<?php
include(dirname(__FILE__).'/../../ext/session/tests/skipif.inc');
include(__DIR__.'/../../ext/session/tests/skipif.inc');
?>
--FILE--

View file

@ -1,7 +1,7 @@
--TEST--
unset() CV 6 (indirect unset() of global variable in session_unset())
--SKIPIF--
<?php include(dirname(__FILE__).'/../../ext/session/tests/skipif.inc'); ?>
<?php include(__DIR__.'/../../ext/session/tests/skipif.inc'); ?>
--INI--
session.auto_start=0
session.save_handler=files

View file

@ -5,7 +5,7 @@ bzread() tests
--FILE--
<?php
$fd = bzopen(dirname(__FILE__)."/003私はガラスを食べられます.txt.bz2","r");
$fd = bzopen(__DIR__."/003私はガラスを食べられます.txt.bz2","r");
var_dump(bzread($fd, 0));
var_dump(bzread($fd, -10));
var_dump(bzread($fd, 1));

View file

@ -5,7 +5,7 @@ bzread() tests
--FILE--
<?php
$fd = bzopen(dirname(__FILE__)."/003.txt.bz2","r");
$fd = bzopen(__DIR__."/003.txt.bz2","r");
var_dump(bzread($fd, 0));
var_dump(bzread($fd, -10));
var_dump(bzread($fd, 1));

View file

@ -5,12 +5,12 @@ bzread() tests with invalid files
--FILE--
<?php
$fd = bzopen(dirname(__FILE__)."/004_1.txt.bz2","r");
$fd = bzopen(__DIR__."/004_1.txt.bz2","r");
var_dump(bzerror($fd));
var_dump(bzerrstr($fd));
var_dump(bzerrno($fd));
$fd2 = bzopen(dirname(__FILE__)."/004_2.txt.bz2","r");
$fd2 = bzopen(__DIR__."/004_2.txt.bz2","r");
var_dump(bzerror($fd2));
var_dump(bzerrstr($fd2));
var_dump(bzerrno($fd2));

View file

@ -21,6 +21,6 @@ $tests = <<<TESTS
\$blaat === \$blaat2
TESTS;
include(dirname(__FILE__) . '/../../../tests/quicktester.inc');
include(__DIR__ . '/../../../tests/quicktester.inc');
--EXPECT--
OK

View file

@ -8,7 +8,7 @@ if (!extension_loaded("com_dotnet")){ echo "skip COM/.Net support not present";
<?php
$text= "Xin chào cộng đồng PHP";
$fpath = str_replace("/", "\\", dirname(__FILE__) . "/bug66431.txt");
$fpath = str_replace("/", "\\", __DIR__ . "/bug66431.txt");
$fso = new COM("Scripting.FileSystemObject");
$fh = $fso->OpenTextFile($fpath, 2, true);
@ -31,7 +31,7 @@ if (!$result) {
--CLEAN--
<?php
$fpath = str_replace("/", "\\", dirname(__FILE__) . "/bug66431.txt");
$fpath = str_replace("/", "\\", __DIR__ . "/bug66431.txt");
if (file_exists($fpath)) {
unlink($fpath);

View file

@ -15,7 +15,7 @@ try {
<?php
$text= "Xin chào cộng đồng PHP";
$fpath = str_replace("/", "\\", dirname(__FILE__) . "/bug66431.docx");
$fpath = str_replace("/", "\\", __DIR__ . "/bug66431.docx");
com_load_typelib('Word.Application');
@ -49,7 +49,7 @@ if (!$result) {
--CLEAN--
<?php
$fpath = str_replace("/", "\\", dirname(__FILE__) . "/bug66431.docx");
$fpath = str_replace("/", "\\", __DIR__ . "/bug66431.docx");
if (file_exists($fpath)) {
unlink($fpath);

View file

@ -5,7 +5,7 @@ Bug #48203 (Crash when CURLOPT_STDERR is set to regular file)
--FILE--
<?php
include 'server.inc';
$fp = fopen(dirname(__FILE__) . '/bug48203.tmp', 'w');
$fp = fopen(__DIR__ . '/bug48203.tmp', 'w');
$ch = curl_init();
@ -22,7 +22,7 @@ echo "Ok\n";
?>
--CLEAN--
<?php @unlink(dirname(__FILE__) . '/bug48203.tmp'); ?>
<?php @unlink(__DIR__ . '/bug48203.tmp'); ?>
--EXPECTF--
Warning: curl_exec(): CURLOPT_STDERR resource has gone away, resetting to stderr in %s on line %d
%A

View file

@ -8,7 +8,7 @@ include 'skipif.inc';
<?php
include 'server.inc';
function checkForClosedFilePointer($target_url, $curl_option, $description) {
$fp = fopen(dirname(__FILE__) . '/bug48203.tmp', 'w');
$fp = fopen(__DIR__ . '/bug48203.tmp', 'w');
$ch1 = curl_init();
$ch2 = curl_init();
@ -65,7 +65,7 @@ foreach($options_to_check as $option) {
?>
--CLEAN--
<?php @unlink(dirname(__FILE__) . '/bug48203.tmp'); ?>
<?php @unlink(__DIR__ . '/bug48203.tmp'); ?>
--EXPECTF--
Warning: curl_multi_exec(): CURLOPT_STDERR resource has gone away, resetting to stderr in %s on line %d

View file

@ -11,7 +11,7 @@ if(substr(PHP_OS, 0, 3) == 'WIN' ) {
<?php
function checkForClosedFilePointer($host, $curl_option, $description) {
$fp = fopen(dirname(__FILE__) . '/bug54798.tmp', 'w+');
$fp = fopen(__DIR__ . '/bug54798.tmp', 'w+');
$ch = curl_init();
@ -54,7 +54,7 @@ foreach($options_to_check as $option) {
?>
===DONE===
--CLEAN--
<?php @unlink(dirname(__FILE__) . '/bug54798.tmp'); ?>
<?php @unlink(__DIR__ . '/bug54798.tmp'); ?>
--EXPECTF--
%a
%aOk for CURLOPT_STDERR

View file

@ -8,7 +8,7 @@ include 'skipif.inc';
<?php
function checkForClosedFilePointer($host, $curl_option, $description) {
$fp = fopen(dirname(__FILE__) . '/bug54798.tmp', 'w+');
$fp = fopen(__DIR__ . '/bug54798.tmp', 'w+');
$ch = curl_init();
@ -51,7 +51,7 @@ foreach($options_to_check as $option) {
?>
===DONE===
--CLEAN--
<?php @unlink(dirname(__FILE__) . '/bug54798.tmp'); ?>
<?php @unlink(__DIR__ . '/bug54798.tmp'); ?>
--EXPECTF--
%AOk for CURLOPT_STDERR

View file

@ -5,7 +5,7 @@ Bug #61948 (CURLOPT_COOKIEFILE '' raises open_basedir restriction)
?>
--FILE--
<?php
$base_dir = dirname(__FILE__) . DIRECTORY_SEPARATOR . "bug61948";
$base_dir = __DIR__ . DIRECTORY_SEPARATOR . "bug61948";
mkdir($base_dir . DIRECTORY_SEPARATOR . "foo", 0755, true);
ini_set("open_basedir", $base_dir);
@ -18,7 +18,7 @@ Bug #61948 (CURLOPT_COOKIEFILE '' raises open_basedir restriction)
?>
--CLEAN--
<?php
$base_dir = dirname(__FILE__) . DIRECTORY_SEPARATOR . "bug61948";
$base_dir = __DIR__ . DIRECTORY_SEPARATOR . "bug61948";
rmdir("$base_dir/foo");
rmdir($base_dir);
?>

View file

@ -7,7 +7,7 @@ if (!extension_loaded('curl')) print 'skip';
--FILE--
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'file://'. dirname(__FILE__) . DIRECTORY_SEPARATOR .'curl_testdata1.txt');
curl_setopt($ch, CURLOPT_URL, 'file://'. __DIR__ . DIRECTORY_SEPARATOR .'curl_testdata1.txt');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, false);
$mh = curl_multi_init();

View file

@ -18,7 +18,7 @@ Bug #69316: Use-after-free in php_curl related to CURLOPT_FILE/_INFILE/_WRITEHEA
include 'server.inc';
$host = curl_cli_server_start();
$temp_file = dirname(__FILE__) . '/body.tmp';
$temp_file = __DIR__ . '/body.tmp';
$url = "{$host}/get.inc?test=getpost";
$ch = curl_init();
$f_file = fopen($temp_file, "w") or die("failed to open file\n");
@ -32,7 +32,7 @@ Bug #69316: Use-after-free in php_curl related to CURLOPT_FILE/_INFILE/_WRITEHEA
===DONE===
--CLEAN--
<?php
unlink(dirname(__FILE__) . '/body.tmp');
unlink(__DIR__ . '/body.tmp');
?>
--EXPECTF--
Warning: curl_exec(): CURLOPT_FILE resource has gone away, resetting to default in %s on line %d

View file

@ -11,7 +11,7 @@ include 'server.inc';
$host = curl_cli_server_start();
$ch = curl_init($host);
$temp_file = dirname(__FILE__) . '/curl_file_deleted_before_curl_close.tmp';
$temp_file = __DIR__ . '/curl_file_deleted_before_curl_close.tmp';
if (file_exists($temp_file)) {
unlink($temp_file); // file should not exist before test
}
@ -33,7 +33,7 @@ echo "Closed correctly\n";
?>
--CLEAN--
<?php
unlink(dirname(__FILE__) . '/curl_file_deleted_before_curl_close.tmp');
unlink(__DIR__ . '/curl_file_deleted_before_curl_close.tmp');
?>
--EXPECT--
Closed correctly

View file

@ -17,7 +17,7 @@ Rein Velt (rein@velt.org)
include 'server.inc';
$host = curl_cli_server_start();
curl_setopt($ch1, CURLOPT_URL, "{$host}/get.inc?test=getpost&get_param=Hello%20World");
curl_setopt($ch2, CURLOPT_URL, "file://".dirname(__FILE__). DIRECTORY_SEPARATOR . "curl_testdata2.txt");
curl_setopt($ch2, CURLOPT_URL, "file://".__DIR__. DIRECTORY_SEPARATOR . "curl_testdata2.txt");
curl_setopt($ch1, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch2, CURLOPT_RETURNTRANSFER, true);

View file

@ -19,7 +19,7 @@ function custom_readfunction($oCurl, $hReadHandle, $iMaxOut)
return $sData;
}
$sFileBase = dirname(__FILE__).DIRECTORY_SEPARATOR.'curl_opt_CURLOPT_READFUNCTION';
$sFileBase = __DIR__.DIRECTORY_SEPARATOR.'curl_opt_CURLOPT_READFUNCTION';
$sReadFile = $sFileBase.'_in.tmp';
$sWriteFile = $sFileBase.'_out.tmp';
$sWriteUrl = 'file://'.$sWriteFile;
@ -43,7 +43,7 @@ var_dump($sOutput);
===DONE===
--CLEAN--
<?php
$sFileBase = dirname(__FILE__).DIRECTORY_SEPARATOR.'curl_opt_CURLOPT_READFUNCTION';
$sFileBase = __DIR__.DIRECTORY_SEPARATOR.'curl_opt_CURLOPT_READFUNCTION';
$sReadFile = $sFileBase.'_in.tmp';
$sWriteFile = $sFileBase.'_out.tmp';
unlink($sReadFile);

View file

@ -3,13 +3,13 @@ Bug #36436 (DBA problem with Berkeley DB4)
--SKIPIF--
<?php
$handler = 'db4';
require_once(dirname(__FILE__) .'/skipif.inc');
require_once(__DIR__ .'/skipif.inc');
?>
--FILE--
<?php
$handler = 'db4';
require_once(dirname(__FILE__) .'/test.inc');
require_once(__DIR__ .'/test.inc');
$db = dba_popen($db_filename, 'c', 'db4');
@ -27,7 +27,7 @@ dba_close($db);
===DONE===
--CLEAN--
<?php
require(dirname(__FILE__) .'/clean.inc');
require(__DIR__ .'/clean.inc');
?>
--EXPECTF--
resource(%d) of type (dba persistent)

View file

@ -3,7 +3,7 @@ Bug #38698 (Bug #38698 for some keys cdbmake creates corrupted db and cdb can't
--SKIPIF--
<?php
$handler = 'cdb_make';
require_once(dirname(__FILE__) .'/skipif.inc');
require_once(__DIR__ .'/skipif.inc');
?>
--FILE--
<?php
@ -12,7 +12,7 @@ function isLittleEndian() {
return 0x00FF === current(unpack('v', pack('S',0x00FF)));
}
$db_file = dirname(__FILE__) .'/129php.cdb';
$db_file = __DIR__ .'/129php.cdb';
if (($db_make=dba_open($db_file, "n", 'cdb_make'))!==FALSE) {
if (isLittleEndian() === FALSE) {

View file

@ -3,13 +3,13 @@ Bug #48240 (DBA Segmentation fault dba_nextkey)
--SKIPIF--
<?php
$handler = 'db4';
require_once(dirname(__FILE__) .'/skipif.inc');
require_once(__DIR__ .'/skipif.inc');
?>
--FILE--
<?php
$handler = 'db4';
require_once(dirname(__FILE__) .'/test.inc');
require_once(__DIR__ .'/test.inc');
$db = dba_open($db_filename, 'c', 'db4');
@ -21,7 +21,7 @@ dba_close($db);
===DONE===
--CLEAN--
<?php
require(dirname(__FILE__) .'/clean.inc');
require(__DIR__ .'/clean.inc');
?>
--EXPECT--
bool(false)

View file

@ -3,7 +3,7 @@ Bug #49125 (Error in dba_exists C code)
--SKIPIF--
<?php
$handler = 'db4';
require_once(dirname(__FILE__) .'/skipif.inc');
require_once(__DIR__ .'/skipif.inc');
?>
--FILE--
<?php
@ -11,7 +11,7 @@ Bug #49125 (Error in dba_exists C code)
error_reporting(E_ALL);
$handler = 'db4';
require_once(dirname(__FILE__) .'/test.inc');
require_once(__DIR__ .'/test.inc');
$db = dba_popen($db_filename, 'c', 'db4');
@ -24,7 +24,7 @@ dba_close($db);
?>
--CLEAN--
<?php
require(dirname(__FILE__) .'/clean.inc');
require(__DIR__ .'/clean.inc');
?>
--EXPECT--
bool(true)

View file

@ -2,14 +2,14 @@
Bug #65708 (dba functions cast $key param to string in-place, bypassing copy on write)
--SKIPIF--
<?php
require_once(dirname(__FILE__) .'/skipif.inc');
require_once(__DIR__ .'/skipif.inc');
?>
--FILE--
<?php
error_reporting(E_ALL);
require_once(dirname(__FILE__) .'/test.inc');
require_once(__DIR__ .'/test.inc');
$db = dba_popen($db_filename, 'c');
@ -29,7 +29,7 @@ dba_close($db);
?>
--CLEAN--
<?php
require(dirname(__FILE__) .'/clean.inc');
require(__DIR__ .'/clean.inc');
?>
--EXPECT--
integer

View file

@ -2,7 +2,7 @@
Bug #72157 (use-after-free caused by dba_open)
--SKIPIF--
<?php
require_once(dirname(__FILE__) .'/skipif.inc');
require_once(__DIR__ .'/skipif.inc');
?>
--FILE--
<?php

View file

@ -3,12 +3,12 @@ Bug #72885 flatfile: dba_fetch() fails to read replaced entry
--SKIPIF--
<?php
$handler = "flatfile";
require_once(dirname(__FILE__) .'/skipif.inc');
require_once(__DIR__ .'/skipif.inc');
?>
--FILE--
<?php
require_once(dirname(__FILE__) .'/test.inc');
require_once(__DIR__ .'/test.inc');
$db = dba_open($db_filename, 'c', 'flatfile');
dba_insert('foo', 'bar', $db);
@ -20,7 +20,7 @@ dba_close($db);
===DONE===
--CLEAN--
<?php
require_once(dirname(__FILE__) .'/clean.inc');
require_once(__DIR__ .'/clean.inc');
?>
--EXPECT--
bool(true)

View file

@ -2,12 +2,12 @@
DBA File Creation Test
--SKIPIF--
<?php
require_once(dirname(__FILE__) .'/skipif.inc');
require_once(__DIR__ .'/skipif.inc');
die("info $HND handler used");
?>
--FILE--
<?php
require_once(dirname(__FILE__) .'/test.inc');
require_once(__DIR__ .'/test.inc');
echo "database handler: $handler\n";
if (($db_file=dba_open($db_file, "n", $handler))!==FALSE) {
echo "database file created\n";
@ -18,7 +18,7 @@ DBA File Creation Test
?>
--CLEAN--
<?php
require(dirname(__FILE__) .'/clean.inc');
require(__DIR__ .'/clean.inc');
?>
--EXPECTF--
database handler: %s

View file

@ -2,12 +2,12 @@
DBA Insert/Fetch Test
--SKIPIF--
<?php
require_once(dirname(__FILE__) .'/skipif.inc');
require_once(__DIR__ .'/skipif.inc');
die("info $HND handler used");
?>
--FILE--
<?php
require_once(dirname(__FILE__) .'/test.inc');
require_once(__DIR__ .'/test.inc');
echo "database handler: $handler\n";
if (($db_file=dba_open($db_file, "n", $handler))!==FALSE) {
dba_insert("key1", "This is a test insert", $db_file);
@ -19,7 +19,7 @@ DBA Insert/Fetch Test
?>
--CLEAN--
<?php
require(dirname(__FILE__) .'/clean.inc');
require(__DIR__ .'/clean.inc');
?>
--EXPECTF--
database handler: %s

View file

@ -2,12 +2,12 @@
DBA Insert/Replace/Fetch Test
--SKIPIF--
<?php
require_once(dirname(__FILE__) .'/skipif.inc');
require_once(__DIR__ .'/skipif.inc');
die("info $HND handler used");
?>
--FILE--
<?php
require_once(dirname(__FILE__) .'/test.inc');
require_once(__DIR__ .'/test.inc');
echo "database handler: $handler\n";
if (($db_file=dba_open($db_file, "n", $handler))!==FALSE) {
dba_insert("key1", "This is a test insert", $db_file);
@ -21,7 +21,7 @@ DBA Insert/Replace/Fetch Test
?>
--CLEAN--
<?php
require(dirname(__FILE__) .'/clean.inc');
require(__DIR__ .'/clean.inc');
?>
--EXPECTF--
database handler: %s

View file

@ -2,12 +2,12 @@
DBA Multiple Insert/Fetch Test
--SKIPIF--
<?php
require_once(dirname(__FILE__) .'/skipif.inc');
require_once(__DIR__ .'/skipif.inc');
die("info $HND handler used");
?>
--FILE--
<?php
require_once(dirname(__FILE__) .'/test.inc');
require_once(__DIR__ .'/test.inc');
echo "database handler: $handler\n";
if (($db_file=dba_open($db_file, "n", $handler))!==FALSE) {
dba_insert("key1", "Content String 1", $db_file);
@ -25,7 +25,7 @@ DBA Multiple Insert/Fetch Test
?>
--CLEAN--
<?php
require(dirname(__FILE__) .'/clean.inc');
require(__DIR__ .'/clean.inc');
?>
--EXPECTF--
database handler: %s

View file

@ -2,12 +2,12 @@
DBA FirstKey/NextKey Loop Test With 5 Items
--SKIPIF--
<?php
require_once(dirname(__FILE__) .'/skipif.inc');
require_once(__DIR__ .'/skipif.inc');
die("info $HND handler used");
?>
--FILE--
<?php
require_once(dirname(__FILE__) .'/test.inc');
require_once(__DIR__ .'/test.inc');
echo "database handler: $handler\n";
if (($db_file=dba_open($db_file, "n", $handler))!==FALSE) {
dba_insert("key1", "Content String 1", $db_file);
@ -32,7 +32,7 @@ DBA FirstKey/NextKey Loop Test With 5 Items
?>
--CLEAN--
<?php
require(dirname(__FILE__) .'/clean.inc');
require(__DIR__ .'/clean.inc');
?>
--EXPECTF--
database handler: %s

View file

@ -2,12 +2,12 @@
DBA FirstKey/NextKey with 2 deletes
--SKIPIF--
<?php
require_once(dirname(__FILE__) .'/skipif.inc');
require_once(__DIR__ .'/skipif.inc');
die("info $HND handler used");
?>
--FILE--
<?php
require_once(dirname(__FILE__) .'/test.inc');
require_once(__DIR__ .'/test.inc');
echo "database handler: $handler\n";
if (($db_file=dba_open($db_file, "n", $handler))!==FALSE) {
dba_insert("key1", "Content String 1", $db_file);
@ -34,7 +34,7 @@ DBA FirstKey/NextKey with 2 deletes
?>
--CLEAN--
<?php
require(dirname(__FILE__) .'/clean.inc');
require(__DIR__ .'/clean.inc');
?>
--EXPECTF--
database handler: %s

View file

@ -2,16 +2,16 @@
DBA Multiple File Creation Test
--SKIPIF--
<?php
require_once(dirname(__FILE__) .'/skipif.inc');
require_once(__DIR__ .'/skipif.inc');
if (!function_exists('dba_list')) die('skip dba_list() not available');
die("info $HND handler used");
?>
--FILE--
<?php
require_once(dirname(__FILE__) .'/test.inc');
require_once(__DIR__ .'/test.inc');
echo "database handler: $handler\n";
$db_file1 = $db_filename1 = dirname(__FILE__).'/test1.dbm';
$db_file2 = $db_filename2 = dirname(__FILE__).'/test2.dbm';
$db_file1 = $db_filename1 = __DIR__.'/test1.dbm';
$db_file2 = $db_filename2 = __DIR__.'/test2.dbm';
if (($db_file=dba_open($db_file, "n", $handler))!==FALSE) {
echo "database file created\n";
} else {
@ -35,7 +35,7 @@ DBA Multiple File Creation Test
?>
--CLEAN--
<?php
require(dirname(__FILE__) .'/clean.inc');
require(__DIR__ .'/clean.inc');
?>
--EXPECTF--
database handler: %s

View file

@ -2,12 +2,12 @@
DBA dba_popen Test
--SKIPIF--
<?php
require_once(dirname(__FILE__) .'/skipif.inc');
require_once(__DIR__ .'/skipif.inc');
print("info $HND handler used");
?>
--FILE--
<?php
require_once(dirname(__FILE__) .'/test.inc');
require_once(__DIR__ .'/test.inc');
echo "database handler: $handler\n";
if (($db=dba_popen($db_file, "n", $handler))!==FALSE) {
echo "Opened\n";
@ -26,7 +26,7 @@ DBA dba_popen Test
?>
--CLEAN--
<?php
require(dirname(__FILE__) .'/clean.inc');
require(__DIR__ .'/clean.inc');
?>
--EXPECTF--
database handler: %s

View file

@ -2,12 +2,12 @@
DBA with array keys
--SKIPIF--
<?php
require_once(dirname(__FILE__) .'/skipif.inc');
require_once(__DIR__ .'/skipif.inc');
die("info $HND handler used");
?>
--FILE--
<?php
require_once(dirname(__FILE__) .'/test.inc');
require_once(__DIR__ .'/test.inc');
echo "database handler: $handler\n";
if (($db_file=dba_open($db_file, "n", $handler))!==FALSE) {
dba_insert(array("", "name0") , "Content String 1", $db_file);
@ -37,7 +37,7 @@ if (($db_file=dba_open($db_file, "n", $handler))!==FALSE) {
?>
--CLEAN--
<?php
require(dirname(__FILE__) .'/clean.inc');
require(__DIR__ .'/clean.inc');
?>
--EXPECTF--
database handler: %s

View file

@ -2,12 +2,12 @@
DBA argument tests
--SKIPIF--
<?php
require_once(dirname(__FILE__) .'/skipif.inc');
require_once(__DIR__ .'/skipif.inc');
die("info $HND handler used");
?>
--FILE--
<?php
require_once(dirname(__FILE__) .'/test.inc');
require_once(__DIR__ .'/test.inc');
echo "database handler: $handler\n";
var_dump(dba_open($db_file, 'n'));
var_dump(dba_open($db_file, 'n', 'bogus'));
@ -17,7 +17,7 @@ var_dump(dba_open($db_file, 'n', $handler, 2, 3, 4, 5, 6, 7, 8));
?>
--CLEAN--
<?php
require(dirname(__FILE__) .'/clean.inc');
require(__DIR__ .'/clean.inc');
?>
--EXPECTF--
database handler: flatfile

View file

@ -3,14 +3,14 @@ DBA dba.default_handler tests
--SKIPIF--
<?php
$handler = "flatfile";
require_once(dirname(__FILE__) .'/skipif.inc');
require_once(__DIR__ .'/skipif.inc');
?>
--INI--
dba.default_handler=flatfile
--FILE--
<?php
$handler = "flatfile";
require_once(dirname(__FILE__) .'/test.inc');
require_once(__DIR__ .'/test.inc');
echo "database handler: $handler\n";
echo "Test 1\n";
@ -28,7 +28,7 @@ var_dump(dba_open($db_filename, 'n'));
?>
--CLEAN--
<?php
require(dirname(__FILE__) .'/clean.inc');
require(__DIR__ .'/clean.inc');
?>
--EXPECTF--
database handler: flatfile

View file

@ -2,12 +2,12 @@
DBA with array key with empty array
--SKIPIF--
<?php
require_once(dirname(__FILE__) .'/skipif.inc');
require_once(__DIR__ .'/skipif.inc');
die("info $HND handler used");
?>
--FILE--
<?php
require_once(dirname(__FILE__) .'/test.inc');
require_once(__DIR__ .'/test.inc');
echo "database handler: $handler\n";
if (($db_file=dba_open($db_file, "n", $handler))!==FALSE) {
@ -19,7 +19,7 @@ if (($db_file=dba_open($db_file, "n", $handler))!==FALSE) {
?>
--CLEAN--
<?php
require(dirname(__FILE__) .'/clean.inc');
require(__DIR__ .'/clean.inc');
?>
--EXPECTF--
database handler: %s

View file

@ -2,12 +2,12 @@
DBA with array key with array containing too many elements
--SKIPIF--
<?php
require_once(dirname(__FILE__) .'/skipif.inc');
require_once(__DIR__ .'/skipif.inc');
die("info $HND handler used");
?>
--FILE--
<?php
require_once(dirname(__FILE__) .'/test.inc');
require_once(__DIR__ .'/test.inc');
echo "database handler: $handler\n";
if (($db_file=dba_open($db_file, "n", $handler))!==FALSE) {
@ -19,7 +19,7 @@ if (($db_file=dba_open($db_file, "n", $handler))!==FALSE) {
?>
--CLEAN--
<?php
require(dirname(__FILE__) .'/clean.inc');
require(__DIR__ .'/clean.inc');
?>
--EXPECTF--
database handler: %s

View file

@ -3,14 +3,14 @@ DBA with persistent connections
--SKIPIF--
<?php
$handler = "flatfile";
require_once(dirname(__FILE__) .'/skipif.inc');
require_once(__DIR__ .'/skipif.inc');
die("info $HND handler used");
?>
--FILE--
<?php
$handler = "flatfile";
require_once(dirname(__FILE__) .'/test.inc');
require_once(__DIR__ .'/test.inc');
echo "database handler: $handler\n";
echo "Test 1\n";
@ -51,7 +51,7 @@ echo dba_fetch("key2", $db_file1), "\n";
===DONE===
--CLEAN--
<?php
require(dirname(__FILE__) .'/clean.inc');
require(__DIR__ .'/clean.inc');
?>
--EXPECTF--
database handler: flatfile

View file

@ -3,13 +3,13 @@ DBA lock modifier error message test
--SKIPIF--
<?php
$handler = "flatfile";
require_once(dirname(__FILE__) .'/skipif.inc');
require_once(__DIR__ .'/skipif.inc');
?>
--FILE--
<?php
$handler = "flatfile";
require_once(dirname(__FILE__) .'/test.inc');
require_once(__DIR__ .'/test.inc');
echo "database handler: $handler\n";
$db_file1 = dba_popen($db_filename, 'n-t', 'flatfile');
@ -18,7 +18,7 @@ $db_file1 = dba_popen($db_filename, 'n-t', 'flatfile');
===DONE===
--CLEAN--
<?php
require(dirname(__FILE__) .'/clean.inc');
require(__DIR__ .'/clean.inc');
?>
--EXPECTF--
database handler: flatfile

View file

@ -3,19 +3,19 @@ DBA CDB handler test
--SKIPIF--
<?php
$handler = 'cdb';
require_once(dirname(__FILE__) .'/skipif.inc');
require_once(__DIR__ .'/skipif.inc');
die('info CDB does not support replace or delete');
?>
--FILE--
<?php
$handler = 'cdb';
require_once(dirname(__FILE__) .'/test.inc');
require_once(dirname(__FILE__) .'/dba_handler.inc');
require_once(__DIR__ .'/test.inc');
require_once(__DIR__ .'/dba_handler.inc');
?>
===DONE===
--CLEAN--
<?php
require(dirname(__FILE__) .'/clean.inc');
require(__DIR__ .'/clean.inc');
?>
--EXPECT--
database handler: cdb

View file

@ -3,14 +3,14 @@ DBA CDB handler test
--SKIPIF--
<?php
$handler = 'cdb';
require_once(dirname(__FILE__) .'/skipif.inc');
require_once(__DIR__ .'/skipif.inc');
die('info CDB does not support replace or delete');
?>
--FILE--
<?php
$handler = 'cdb';
require_once(dirname(__FILE__) .'/test.inc');
require_once(__DIR__ .'/test.inc');
echo "Test 0\n";
@ -64,7 +64,7 @@ else {
===DONE===
--CLEAN--
<?php
require(dirname(__FILE__) .'/clean.inc');
require(__DIR__ .'/clean.inc');
?>
--EXPECTF--
Test 0

View file

@ -3,16 +3,16 @@ DBA CDB_MAKE handler test
--SKIPIF--
<?php
$handler = 'cdb_make';
require_once(dirname(__FILE__) .'/skipif.inc');
require_once(__DIR__ .'/skipif.inc');
die('info CDB_MAKE does not support reading');
?>
--FILE--
<?php
$handler = 'cdb_make';
require_once(dirname(__FILE__) .'/test.inc');
require_once(__DIR__ .'/test.inc');
echo "database handler: $handler\n";
// print md5 checksum of test.cdb which is generated by cdb_make program
var_dump(md5_file(dirname(__FILE__).'/test.cdb'));
var_dump(md5_file(__DIR__.'/test.cdb'));
if (($db_make=dba_open($db_file, "n", $handler))!==FALSE) {
dba_insert("1", "1", $db_make);
dba_insert("2", "2", $db_make);
@ -32,7 +32,7 @@ DBA CDB_MAKE handler test
?>
--CLEAN--
<?php
require(dirname(__FILE__) .'/clean.inc');
require(__DIR__ .'/clean.inc');
?>
--EXPECT--
database handler: cdb_make

View file

@ -3,13 +3,13 @@ DBA CDB handler test (read only)
--SKIPIF--
<?php
$handler = 'cdb_make';
require_once dirname(__FILE__) .'/skipif.inc';
require_once __DIR__ .'/skipif.inc';
?>
--FILE--
<?php
echo "database handler: cdb\n";
$handler = 'cdb';
$db_file = dirname(__FILE__).'/test.cdb';
$db_file = __DIR__.'/test.cdb';
if (($db_file=dba_open($db_file, "r", $handler))!==FALSE) {
// read key sequence
$a = dba_firstkey($db_file);

View file

@ -3,13 +3,13 @@ DBA DB1 handler test
--SKIPIF--
<?php
$handler = 'db1';
require_once dirname(__FILE__) .'/skipif.inc';
require_once __DIR__ .'/skipif.inc';
?>
--FILE--
<?php
$handler = 'db1';
require_once dirname(__FILE__) .'/test.inc';
require_once dirname(__FILE__) .'/dba_handler.inc';
require_once __DIR__ .'/test.inc';
require_once __DIR__ .'/dba_handler.inc';
?>
===DONE===
--EXPECT--

View file

@ -3,13 +3,13 @@ DBA DB2 handler test
--SKIPIF--
<?php
$handler = 'db2';
require_once dirname(__FILE__) .'/skipif.inc';
require_once __DIR__ .'/skipif.inc';
?>
--FILE--
<?php
$handler = 'db2';
require_once dirname(__FILE__) .'/test.inc';
require_once dirname(__FILE__) .'/dba_handler.inc';
require_once __DIR__ .'/test.inc';
require_once __DIR__ .'/dba_handler.inc';
?>
===DONE===
--EXPECT--

View file

@ -3,13 +3,13 @@ DBA DB3 handler test
--SKIPIF--
<?php
$handler = 'db3';
require_once dirname(__FILE__) .'/skipif.inc';
require_once __DIR__ .'/skipif.inc';
?>
--FILE--
<?php
$handler = 'db3';
require_once dirname(__FILE__) .'/test.inc';
require_once dirname(__FILE__) .'/dba_handler.inc';
require_once __DIR__ .'/test.inc';
require_once __DIR__ .'/dba_handler.inc';
?>
===DONE===
--EXPECT--

View file

@ -3,18 +3,18 @@ DBA DB4 handler test
--SKIPIF--
<?php
$handler = 'db4';
require_once(dirname(__FILE__) .'/skipif.inc');
require_once(__DIR__ .'/skipif.inc');
?>
--FILE--
<?php
$handler = 'db4';
require_once(dirname(__FILE__) .'/test.inc');
require_once(dirname(__FILE__) .'/dba_handler.inc');
require_once(__DIR__ .'/test.inc');
require_once(__DIR__ .'/dba_handler.inc');
?>
===DONE===
--CLEAN--
<?php
require(dirname(__FILE__) .'/clean.inc');
require(__DIR__ .'/clean.inc');
?>
--EXPECT--
database handler: db4

View file

@ -3,14 +3,14 @@ DBA DB4 New File Creation open("c") & Insert Test
--SKIPIF--
<?php
$handler = "db4";
require_once(dirname(__FILE__) .'/skipif.inc');
require_once(__DIR__ .'/skipif.inc');
die("info $HND handler used");
?>
--FILE--
<?php
$handler = "db4";
require_once(dirname(__FILE__) .'/test.inc');
require_once(__DIR__ .'/test.inc');
echo "database handler: $handler\n";
if (($db_file = dba_open($db_filename, "c", $handler)) !== FALSE) {
echo "database file created\n";
@ -24,7 +24,7 @@ if (($db_file = dba_open($db_filename, "c", $handler)) !== FALSE) {
?>
--CLEAN--
<?php
require(dirname(__FILE__) .'/clean.inc');
require(__DIR__ .'/clean.inc');
?>
--EXPECT--
database handler: db4

View file

@ -3,14 +3,14 @@ DBA DB4 New File Creation open("n") & Insert Test
--SKIPIF--
<?php
$handler = "db4";
require_once(dirname(__FILE__) .'/skipif.inc');
require_once(__DIR__ .'/skipif.inc');
die("info $HND handler used");
?>
--FILE--
<?php
$handler = "db4";
require_once(dirname(__FILE__) .'/test.inc');
require_once(__DIR__ .'/test.inc');
echo "database handler: $handler\n";
if (($db_file = dba_open($db_filename, "n", $handler)) !== FALSE) {
echo "database file created\n";
@ -24,7 +24,7 @@ if (($db_file = dba_open($db_filename, "n", $handler)) !== FALSE) {
?>
--CLEAN--
<?php
require(dirname(__FILE__) .'/clean.inc');
require(__DIR__ .'/clean.inc');
?>
--EXPECT--
database handler: db4

View file

@ -3,14 +3,14 @@ DBA DB4 File Creation open("c") with existing file
--SKIPIF--
<?php
$handler = "db4";
require_once(dirname(__FILE__) .'/skipif.inc');
require_once(__DIR__ .'/skipif.inc');
die("info $HND handler used");
?>
--FILE--
<?php
$handler = "db4";
require_once(dirname(__FILE__) .'/test.inc');
require_once(__DIR__ .'/test.inc');
echo "database handler: $handler\n";
var_dump(file_put_contents($db_filename, "Dummy contents"));
@ -33,7 +33,7 @@ echo "$s\n";
?>
--CLEAN--
<?php
require(dirname(__FILE__) .'/clean.inc');
require(__DIR__ .'/clean.inc');
?>
--EXPECTF--
database handler: db4

View file

@ -3,14 +3,14 @@ DBA DB4 Truncate Existing File open("n")
--SKIPIF--
<?php
$handler = "db4";
require_once(dirname(__FILE__) .'/skipif.inc');
require_once(__DIR__ .'/skipif.inc');
die("info $HND handler used");
?>
--FILE--
<?php
$handler = "db4";
require_once(dirname(__FILE__) .'/test.inc');
require_once(__DIR__ .'/test.inc');
echo "database handler: $handler\n";
var_dump(file_put_contents($db_filename, "Dummy contents"));
@ -31,7 +31,7 @@ if (($db_file = dba_open($db_filename, "n", $handler)) !== FALSE) {
?>
--CLEAN--
<?php
require(dirname(__FILE__) .'/clean.inc');
require(__DIR__ .'/clean.inc');
?>
--EXPECT--
database handler: db4

View file

@ -3,14 +3,14 @@ DBA DB4 New File Creation popen("c") & Insert Test
--SKIPIF--
<?php
$handler = "db4";
require_once(dirname(__FILE__) .'/skipif.inc');
require_once(__DIR__ .'/skipif.inc');
die("info $HND handler used");
?>
--FILE--
<?php
$handler = "db4";
require_once(dirname(__FILE__) .'/test.inc');
require_once(__DIR__ .'/test.inc');
echo "database handler: $handler\n";
if (($db_file = dba_popen($db_filename, "c", $handler)) !== FALSE) {
echo "database file created\n";
@ -24,7 +24,7 @@ if (($db_file = dba_popen($db_filename, "c", $handler)) !== FALSE) {
?>
--CLEAN--
<?php
require(dirname(__FILE__) .'/clean.inc');
require(__DIR__ .'/clean.inc');
?>
--EXPECT--
database handler: db4

View file

@ -3,14 +3,14 @@ DBA DB4 New File Creation popen("n") & Insert Test
--SKIPIF--
<?php
$handler = "db4";
require_once(dirname(__FILE__) .'/skipif.inc');
require_once(__DIR__ .'/skipif.inc');
die("info $HND handler used");
?>
--FILE--
<?php
$handler = "db4";
require_once(dirname(__FILE__) .'/test.inc');
require_once(__DIR__ .'/test.inc');
echo "database handler: $handler\n";
if (($db_file = dba_popen($db_filename, "n", $handler)) !== FALSE) {
echo "database file created\n";
@ -24,7 +24,7 @@ if (($db_file = dba_popen($db_filename, "n", $handler)) !== FALSE) {
?>
--CLEAN--
<?php
require(dirname(__FILE__) .'/clean.inc');
require(__DIR__ .'/clean.inc');
?>
--EXPECT--
database handler: db4

View file

@ -3,14 +3,14 @@ DBA DB4 File Creation popen("c") with existing invalid file
--SKIPIF--
<?php
$handler = "db4";
require_once(dirname(__FILE__) .'/skipif.inc');
require_once(__DIR__ .'/skipif.inc');
die("info $HND handler used");
?>
--FILE--
<?php
$handler = "db4";
require_once(dirname(__FILE__) .'/test.inc');
require_once(__DIR__ .'/test.inc');
echo "database handler: $handler\n";
var_dump(file_put_contents($db_filename, "Dummy contents"));
@ -29,7 +29,7 @@ if (($db_file = dba_popen($db_filename, "c", $handler)) !== FALSE) {
?>
--CLEAN--
<?php
require(dirname(__FILE__) .'/clean.inc');
require(__DIR__ .'/clean.inc');
?>
--EXPECTF--
database handler: db4

View file

@ -3,14 +3,14 @@ DBA DB4 Truncate Existing File popen("n")
--SKIPIF--
<?php
$handler = "db4";
require_once(dirname(__FILE__) .'/skipif.inc');
require_once(__DIR__ .'/skipif.inc');
die("info $HND handler used");
?>
--FILE--
<?php
$handler = "db4";
require_once(dirname(__FILE__) .'/test.inc');
require_once(__DIR__ .'/test.inc');
echo "database handler: $handler\n";
var_dump(file_put_contents($db_filename, "Dummy contents"));
@ -31,7 +31,7 @@ if (($db_file = dba_popen($db_filename, "n", $handler)) !== FALSE) {
?>
--CLEAN--
<?php
require(dirname(__FILE__) .'/clean.inc');
require(__DIR__ .'/clean.inc');
?>
--EXPECT--
database handler: db4

View file

@ -3,16 +3,16 @@ DBA DB4 Multiple File Creation Test
--SKIPIF--
<?php
$handler = "db4";
require_once(dirname(__FILE__) .'/skipif.inc');
require_once(__DIR__ .'/skipif.inc');
die("info $HND handler used");
?>
--FILE--
<?php
$handler = "db4";
require_once(dirname(__FILE__) .'/test.inc');
require_once(__DIR__ .'/test.inc');
echo "database handler: $handler\n";
$db_file1 = $db_filename1 = dirname(__FILE__).'/test1.dbm';
$db_file2 = $db_filename2 = dirname(__FILE__).'/test2.dbm';
$db_file1 = $db_filename1 = __DIR__.'/test1.dbm';
$db_file2 = $db_filename2 = __DIR__.'/test2.dbm';
if (($db_file=dba_open($db_file, "n", $handler))!==FALSE) {
echo "database file created\n";
} else {
@ -36,7 +36,7 @@ dba_close($db_file);
?>
--CLEAN--
<?php
require(dirname(__FILE__) .'/clean.inc');
require(__DIR__ .'/clean.inc');
?>
--EXPECTF--
database handler: db4

View file

@ -3,13 +3,13 @@ DBA DB4 with repeated key
--SKIPIF--
<?php
$handler = "db4";
require_once(dirname(__FILE__) .'/skipif.inc');
require_once(__DIR__ .'/skipif.inc');
die("info $HND handler used");
?>
--FILE--
<?php
$handler = "db4";
require_once(dirname(__FILE__) .'/test.inc');
require_once(__DIR__ .'/test.inc');
echo "database handler: $handler\n";
if (($db_file=dba_open($db_filename, "c", $handler))!==FALSE) {
var_dump(dba_insert("key1", "Content String 1", $db_file));
@ -25,7 +25,7 @@ if (($db_file=dba_open($db_filename, "c", $handler))!==FALSE) {
?>
--CLEAN--
<?php
require(dirname(__FILE__) .'/clean.inc');
require(__DIR__ .'/clean.inc');
?>
--EXPECT--
database handler: db4

View file

@ -3,14 +3,14 @@ DBA DB4 New File Creation open("rl")
--SKIPIF--
<?php
$handler = "db4";
require_once(dirname(__FILE__) .'/skipif.inc');
require_once(__DIR__ .'/skipif.inc');
die("info $HND handler used");
?>
--FILE--
<?php
$handler = "db4";
require_once(dirname(__FILE__) .'/test.inc');
require_once(__DIR__ .'/test.inc');
echo "database handler: $handler\n";
if (($db_file = dba_open($db_filename, "rl", $handler)) !== FALSE) {
echo "database file created\n";
@ -22,7 +22,7 @@ if (($db_file = dba_open($db_filename, "rl", $handler)) !== FALSE) {
?>
--CLEAN--
<?php
require(dirname(__FILE__) .'/clean.inc');
require(__DIR__ .'/clean.inc');
?>
--EXPECTF--
database handler: db4

View file

@ -3,14 +3,14 @@ DBA DB4 File open("rl") & Insert Test
--SKIPIF--
<?php
$handler = "db4";
require_once(dirname(__FILE__) .'/skipif.inc');
require_once(__DIR__ .'/skipif.inc');
die("info $HND handler used");
?>
--FILE--
<?php
$handler = "db4";
require_once(dirname(__FILE__) .'/test.inc');
require_once(__DIR__ .'/test.inc');
echo "database handler: $handler\n";
if (($db_file = dba_popen($db_filename, "c", $handler)) !== FALSE) {
@ -30,7 +30,7 @@ if (($db_file = dba_popen($db_filename, "rl", $handler)) !== FALSE) {
?>
--CLEAN--
<?php
require(dirname(__FILE__) .'/clean.inc');
require(__DIR__ .'/clean.inc');
?>
--EXPECTF--
database handler: db4

View file

@ -3,14 +3,14 @@ DBA DB4 File open("wl") & Insert Test
--SKIPIF--
<?php
$handler = "db4";
require_once(dirname(__FILE__) .'/skipif.inc');
require_once(__DIR__ .'/skipif.inc');
die("info $HND handler used");
?>
--FILE--
<?php
$handler = "db4";
require_once(dirname(__FILE__) .'/test.inc');
require_once(__DIR__ .'/test.inc');
echo "database handler: $handler\n";
if (($db_file = dba_open($db_filename, "wl", $handler)) !== FALSE) {
@ -23,7 +23,7 @@ if (($db_file = dba_open($db_filename, "wl", $handler)) !== FALSE) {
?>
--CLEAN--
<?php
require(dirname(__FILE__) .'/clean.inc');
require(__DIR__ .'/clean.inc');
?>
--EXPECTF--
database handler: db4

View file

@ -3,14 +3,14 @@ DBA DB4 File open("wl") & Insert Test
--SKIPIF--
<?php
$handler = "db4";
require_once(dirname(__FILE__) .'/skipif.inc');
require_once(__DIR__ .'/skipif.inc');
die("info $HND handler used");
?>
--FILE--
<?php
$handler = "db4";
require_once(dirname(__FILE__) .'/test.inc');
require_once(__DIR__ .'/test.inc');
echo "database handler: $handler\n";
if (($db_file = dba_popen($db_filename, "c", $handler)) !== FALSE) {
@ -30,7 +30,7 @@ if (($db_file = dba_popen($db_filename, "wl", $handler)) !== FALSE) {
?>
--CLEAN--
<?php
require(dirname(__FILE__) .'/clean.inc');
require(__DIR__ .'/clean.inc');
?>
--EXPECT--
database handler: db4

View file

@ -3,14 +3,14 @@ DBA DB4 File Creation popen("c") with existing valid file
--SKIPIF--
<?php
$handler = "db4";
require_once(dirname(__FILE__) .'/skipif.inc');
require_once(__DIR__ .'/skipif.inc');
die("info $HND handler used");
?>
--FILE--
<?php
$handler = "db4";
require_once(dirname(__FILE__) .'/test.inc');
require_once(__DIR__ .'/test.inc');
echo "database handler: $handler\n";
if (($db_file = dba_popen($db_filename, "c", $handler)) !== FALSE) {
@ -45,7 +45,7 @@ if (($db_file = dba_popen($db_filename, "c", $handler)) !== FALSE) {
?>
--CLEAN--
<?php
require(dirname(__FILE__) .'/clean.inc');
require(__DIR__ .'/clean.inc');
?>
--EXPECT--
database handler: db4

View file

@ -3,13 +3,13 @@ DBA DB4 file creation dba_open("cd")
--SKIPIF--
<?php
$handler = "db4";
require_once(dirname(__FILE__) .'/skipif.inc');
require_once(__DIR__ .'/skipif.inc');
?>
--FILE--
<?php
$handler = "db4";
require_once(dirname(__FILE__) .'/test.inc');
require_once(__DIR__ .'/test.inc');
echo "database handler: $handler\n";
if (($db_file = dba_open($db_filename, "cd", $handler)) !== FALSE) {
@ -28,7 +28,7 @@ if (($db_file = dba_open($db_filename, "cd", $handler)) !== FALSE) {
?>
--CLEAN--
<?php
require(dirname(__FILE__) .'/clean.inc');
require(__DIR__ .'/clean.inc');
?>
--EXPECT--
database handler: db4

View file

@ -3,14 +3,14 @@ DBA DB4 with persistent connections
--SKIPIF--
<?php
$handler = "db4";
require_once(dirname(__FILE__) .'/skipif.inc');
require_once(__DIR__ .'/skipif.inc');
die("info $HND handler used");
?>
--FILE--
<?php
$handler = "db4";
require_once(dirname(__FILE__) .'/test.inc');
require_once(__DIR__ .'/test.inc');
echo "database handler: $handler\n";
echo "Test 1\n";
@ -51,7 +51,7 @@ echo dba_fetch("key2", $db_file1), "\n";
===DONE===
--CLEAN--
<?php
require(dirname(__FILE__) .'/clean.inc');
require(__DIR__ .'/clean.inc');
?>
--XFAIL--
Test 6 crashes with dba pointer of NULL, bug http://bugs.php.net/bug.php?id=51278

View file

@ -3,13 +3,13 @@ DBA DB4 Handler Test
--SKIPIF--
<?php
$handler="db4";
require(dirname(__FILE__) .'/skipif.inc');
require(__DIR__ .'/skipif.inc');
die("info $HND handler used");
?>
--FILE--
<?php
$handler="db4";
require_once(dirname(__FILE__) .'/test.inc');
require_once(__DIR__ .'/test.inc');
echo "database handler: $handler\n";
function check($h)
@ -40,7 +40,7 @@ foreach ($h as $key => $val) {
?>
--CLEAN--
<?php
require(dirname(__FILE__) .'/clean.inc');
require(__DIR__ .'/clean.inc');
?>
--EXPECTREGEX--
database handler: db4

View file

@ -3,13 +3,13 @@ DBA DB4 Optimize Test
--SKIPIF--
<?php
$handler = "db4";
require_once(dirname(__FILE__) .'/skipif.inc');
require_once(__DIR__ .'/skipif.inc');
die("info $HND handler used");
?>
--FILE--
<?php
$handler = "db4";
require_once(dirname(__FILE__) .'/test.inc');
require_once(__DIR__ .'/test.inc');
echo "database handler: $handler\n";
if (($db_file=dba_open($db_filename, "n", $handler))!==FALSE) {
dba_insert("key1", "Content String 1", $db_file);
@ -29,7 +29,7 @@ if (($db_file=dba_open($db_filename, "n", $handler))!==FALSE) {
<?php exit(0); ?>
--CLEAN--
<?php
require(dirname(__FILE__) .'/clean.inc');
require(__DIR__ .'/clean.inc');
?>
--EXPECT--
database handler: db4

View file

@ -3,13 +3,13 @@ DBA DB4 Sync Test
--SKIPIF--
<?php
$handler = "db4";
require_once(dirname(__FILE__) .'/skipif.inc');
require_once(__DIR__ .'/skipif.inc');
die("info $HND handler used");
?>
--FILE--
<?php
$handler = "db4";
require_once(dirname(__FILE__) .'/test.inc');
require_once(__DIR__ .'/test.inc');
echo "database handler: $handler\n";
if (($db_file=dba_open($db_filename, "n", $handler))!==FALSE) {
dba_insert("key1", "Content String 1", $db_file);
@ -29,7 +29,7 @@ if (($db_file=dba_open($db_filename, "n", $handler))!==FALSE) {
<?php exit(0); ?>
--CLEAN--
<?php
require(dirname(__FILE__) .'/clean.inc');
require(__DIR__ .'/clean.inc');
?>
--EXPECT--
database handler: db4

View file

@ -3,18 +3,18 @@ DBA DBM handler test
--SKIPIF--
<?php
$handler = 'dbm';
require_once dirname(__FILE__) .'/skipif.inc';
require_once __DIR__ .'/skipif.inc';
?>
--FILE--
<?php
$handler = 'dbm';
require_once dirname(__FILE__) .'/test.inc';
require_once dirname(__FILE__) .'/dba_handler.inc';
require_once __DIR__ .'/test.inc';
require_once __DIR__ .'/dba_handler.inc';
?>
===DONE===
--CLEAN--
<?php
require(dirname(__FILE__) .'/clean.inc');
require(__DIR__ .'/clean.inc');
?>
--EXPECT--
database handler: dbm

View file

@ -3,18 +3,18 @@ DBA FlatFile handler test
--SKIPIF--
<?php
$handler = 'flatfile';
require_once(dirname(__FILE__) .'/skipif.inc');
require_once(__DIR__ .'/skipif.inc');
?>
--FILE--
<?php
$handler = 'flatfile';
require_once(dirname(__FILE__) .'/test.inc');
require_once(dirname(__FILE__) .'/dba_handler.inc');
require_once(__DIR__ .'/test.inc');
require_once(__DIR__ .'/dba_handler.inc');
?>
===DONE===
--CLEAN--
<?php
require(dirname(__FILE__) .'/clean.inc');
require(__DIR__ .'/clean.inc');
?>
--EXPECT--
database handler: flatfile

View file

@ -3,14 +3,14 @@ DBA GDBM handler test
--SKIPIF--
<?php
$handler = 'gdbm';
require_once dirname(__FILE__) .'/skipif.inc';
require_once __DIR__ .'/skipif.inc';
?>
--FILE--
<?php
$handler = 'gdbm';
require_once dirname(__FILE__) .'/test.inc';
require_once __DIR__ .'/test.inc';
$lock_flag = ''; // lock in library
require_once dirname(__FILE__) .'/dba_handler.inc';
require_once __DIR__ .'/dba_handler.inc';
// Read during write is system dependent. Important is that there is no deadlock
?>

View file

@ -3,13 +3,13 @@ DBA Handler Test
--SKIPIF--
<?php
$handler="flatfile";
require(dirname(__FILE__) .'/skipif.inc');
require(__DIR__ .'/skipif.inc');
die("info $HND handler used");
?>
--FILE--
<?php
$handler="flatfile";
require_once(dirname(__FILE__) .'/test.inc');
require_once(__DIR__ .'/test.inc');
echo "database handler: $handler\n";
function check($h)
@ -48,7 +48,7 @@ foreach ($h as $key => $val) {
?>
--CLEAN--
<?php
require(dirname(__FILE__) .'/clean.inc');
require(__DIR__ .'/clean.inc');
?>
--EXPECTF--
database handler: flatfile

View file

@ -3,18 +3,18 @@ DBA INIFILE handler test
--SKIPIF--
<?php
$handler = 'inifile';
require_once dirname(__FILE__) .'/skipif.inc';
require_once __DIR__ .'/skipif.inc';
?>
--FILE--
<?php
$handler = 'inifile';
require_once dirname(__FILE__) .'/test.inc';
require_once dirname(__FILE__) .'/dba_handler.inc';
require_once __DIR__ .'/test.inc';
require_once __DIR__ .'/dba_handler.inc';
?>
===DONE===
--CLEAN--
<?php
require(dirname(__FILE__) .'/clean.inc');
require(__DIR__ .'/clean.inc');
?>
--EXPECT--
database handler: inifile

View file

@ -3,19 +3,19 @@ DBA LMDB handler test
--SKIPIF--
<?php
$handler = 'lmdb';
require_once dirname(__FILE__) .'/skipif.inc';
require_once __DIR__ .'/skipif.inc';
?>
--FILE--
<?php
$handler = 'lmdb';
require_once dirname(__FILE__) .'/test.inc';
require_once __DIR__ .'/test.inc';
$lock_flag = ''; // lock in library
require_once dirname(__FILE__) .'/dba_handler.inc';
require_once __DIR__ .'/dba_handler.inc';
?>
===DONE===
--CLEAN--
<?php
require_once dirname(__FILE__) .'/clean.inc';
require_once __DIR__ .'/clean.inc';
?>
--EXPECTF--
database handler: lmdb

View file

@ -3,13 +3,13 @@ DBA NDBM handler test
--SKIPIF--
<?php
$handler = 'ndbm';
require_once dirname(__FILE__) .'/skipif.inc';
require_once __DIR__ .'/skipif.inc';
?>
--FILE--
<?php
$handler = 'ndbm';
require_once dirname(__FILE__) .'/test.inc';
require_once dirname(__FILE__) .'/dba_handler.inc';
require_once __DIR__ .'/test.inc';
require_once __DIR__ .'/dba_handler.inc';
?>
===DONE===
--EXPECT--

View file

@ -2,12 +2,12 @@
DBA Optimize Test
--SKIPIF--
<?php
require_once dirname(__FILE__) .'/skipif.inc';
require_once __DIR__ .'/skipif.inc';
die("info $HND handler used");
?>
--FILE--
<?php
require_once(dirname(__FILE__) .'/test.inc');
require_once(__DIR__ .'/test.inc');
echo "database handler: $handler\n";
if (($db_file=dba_open($db_filename, "n", $handler))!==FALSE) {
dba_insert("key1", "Content String 1", $db_file);
@ -34,7 +34,7 @@ if (($db_file=dba_open($db_filename, "n", $handler))!==FALSE) {
<?php exit(0); ?>
--CLEAN--
<?php
require(dirname(__FILE__) .'/clean.inc');
require(__DIR__ .'/clean.inc');
?>
--EXPECTF--
database handler: flatfile

View file

@ -3,19 +3,19 @@ DBA QDBM handler test
--SKIPIF--
<?php
$handler = 'qdbm';
require_once dirname(__FILE__) .'/skipif.inc';
require_once __DIR__ .'/skipif.inc';
?>
--FILE--
<?php
$handler = 'qdbm';
require_once dirname(__FILE__) .'/test.inc';
require_once __DIR__ .'/test.inc';
$lock_flag = ''; // lock in library
require_once dirname(__FILE__) .'/dba_handler.inc';
require_once __DIR__ .'/dba_handler.inc';
?>
===DONE===
--CLEAN--
<?php
require(dirname(__FILE__) .'/clean.inc');
require(__DIR__ .'/clean.inc');
?>
--EXPECTF--
database handler: qdbm

View file

@ -2,7 +2,7 @@
DBA Split Test
--SKIPIF--
<?php
require_once dirname(__FILE__) .'/skipif.inc';
require_once __DIR__ .'/skipif.inc';
die("info $HND handler used");
?>
--FILE--

View file

@ -2,12 +2,12 @@
DBA Sync Test
--SKIPIF--
<?php
require_once dirname(__FILE__) .'/skipif.inc';
require_once __DIR__ .'/skipif.inc';
die("info $HND handler used");
?>
--FILE--
<?php
require_once(dirname(__FILE__) .'/test.inc');
require_once(__DIR__ .'/test.inc');
echo "database handler: $handler\n";
if (($db_file=dba_open($db_filename, "n", $handler))!==FALSE) {
dba_insert("key1", "Content String 1", $db_file);
@ -34,7 +34,7 @@ if (($db_file=dba_open($db_filename, "n", $handler))!==FALSE) {
<?php exit(0); ?>
--CLEAN--
<?php
require(dirname(__FILE__) .'/clean.inc');
require(__DIR__ .'/clean.inc');
?>
--EXPECTF--
database handler: flatfile

View file

@ -3,20 +3,20 @@ DBA TCADB handler test
--SKIPIF--
<?php
$handler = 'tcadb';
require_once dirname(__FILE__) .'/skipif.inc';
require_once __DIR__ .'/skipif.inc';
?>
--FILE--
<?php
$lock_flag = 'l';
$db_filename = $db_file = dirname(__FILE__) .'/test0.tch';
$db_filename = $db_file = __DIR__ .'/test0.tch';
@unlink($db_filename);
@unlink($db_filename.'.lck');
require_once dirname(__FILE__) .'/dba_handler.inc';
require_once __DIR__ .'/dba_handler.inc';
?>
===DONE===
--CLEAN--
<?php
$db_filename = $db_file = dirname(__FILE__) .'/test0.tch';
$db_filename = $db_file = __DIR__ .'/test0.tch';
@unlink($db_filename);
@unlink($db_filename.'.lck');
?>

View file

@ -5,7 +5,7 @@ Knut Urdalen <knut@php.net>
#PHPTestFest2009 Norway 2009-06-09 \o/
--SKIPIF--
<?php
require_once dirname(__FILE__) .'/skipif.inc';
require_once __DIR__ .'/skipif.inc';
?>
--FILE--
<?php

View file

@ -9,7 +9,7 @@ Lev Radin <prokurator@gmail.com>
<?php
$doc = new DOMDocument;
$doc->load(dirname(__FILE__)."/book.xml");
$doc->load(__DIR__."/book.xml");
var_dump($doc->implementation);

View file

@ -11,7 +11,7 @@ assert.bail=true
--FILE--
<?php
$doc = new DOMDocument();
$result = $doc->loadHTMLFile(dirname(__FILE__) . "/test.html");
$result = $doc->loadHTMLFile(__DIR__ . "/test.html");
assert($result === true);
?>
--EXPECT--

View file

@ -11,7 +11,7 @@ assert.bail=true
--FILE--
<?php
$doc = new DOMDocument();
$result = $doc->loadHTMLFile(dirname(__FILE__) . "/ffff/test.html");
$result = $doc->loadHTMLFile(__DIR__ . "/ffff/test.html");
assert($result === false);
?>
--EXPECTF--

View file

@ -11,7 +11,7 @@ assert.bail=true
--FILE--
<?php
$doc = new DOMDocument();
$result = $doc->loadHTMLFile(dirname(__FILE__) . "/empty.html");
$result = $doc->loadHTMLFile(__DIR__ . "/empty.html");
assert($result === true);
?>
--EXPECTF--

View file

@ -11,7 +11,7 @@ assert.bail=true
--FILE--
<?php
$doc = new DOMDocument();
$result = $doc->loadHTMLFile(dirname(__FILE__) . "/not_well.html");
$result = $doc->loadHTMLFile(__DIR__ . "/not_well.html");
assert($result === true);
?>
--EXPECT--

View file

@ -9,7 +9,7 @@ Lev Radin <prokurator@gmail.com>
<?php
$doc = new DOMDocument;
$doc->load(dirname(__FILE__)."/book.xml");
$doc->load(__DIR__."/book.xml");
var_dump($doc->preserveWhiteSpace);

View file

@ -10,14 +10,14 @@ Lev Radin <prokurator@gmail.com>
echo "Load document with preserveWhiteSpace on\n";
$doc = new DOMDocument;
$doc->load(dirname(__FILE__)."/book.xml");
$doc->load(__DIR__."/book.xml");
echo $doc->saveXML();
echo "\nLoad document with preserveWhiteSpace off\n";
$doc = new DOMDocument;
$doc->preserveWhiteSpace = false;
$doc->load(dirname(__FILE__)."/book.xml");
$doc->load(__DIR__."/book.xml");
echo $doc->saveXML();
?>

Some files were not shown because too many files have changed in this diff Show more