Skip to content
Closed
2 changes: 1 addition & 1 deletion ext/bz2/tests/bug51997.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Bug #51997 (SEEK_CUR with 0 value, returns a warning)

error_reporting(E_ALL);

$filename = "testfile.bz2";
$filename = "bug51997.bz2";
$str = "This is a test string.\n";
$bz = bzopen($filename, "w");
bzwrite($bz, $str);
Expand Down
2 changes: 1 addition & 1 deletion ext/bz2/tests/with_files.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ BZ2 with files

error_reporting(E_ALL);

$filename = "testfile.bz2";
$filename = "with_files.bz2";
$str = "This is a test string.\n";
$bz = bzopen($filename, "w");
bzwrite($bz, $str);
Expand Down
8 changes: 4 additions & 4 deletions ext/spl/tests/SplFileInfo_getInode_basic.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ if (substr(PHP_OS, 0, 3) == 'WIN') die("skip this test not for Windows platforms
<?php

//file
touch ('test_file_ptfi');
$fileInfo = new SplFileInfo('test_file_ptfi');
$result = shell_exec('ls -i test_file_ptfi');
touch ('SplFileInfo_getInode_basic.txt');
$fileInfo = new SplFileInfo('SplFileInfo_getInode_basic.txt');
$result = shell_exec('ls -i SplFileInfo_getInode_basic.txt');
var_dump($fileInfo->getInode() == $result);

?>
--CLEAN--
<?php
unlink('test_file_ptfi');
unlink('SplFileInfo_getInode_basic.txt');
?>
--EXPECTF--
bool(true)
8 changes: 4 additions & 4 deletions ext/spl/tests/SplFileInfo_getPerms_basic.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ if (substr(PHP_OS, 0, 3) == 'WIN') die("skip this test not for Windows platforms
<?php

//file
touch ('test_file_ptfi');
chmod('test_file_ptfi', 0557);
$fileInfo = new SplFileInfo('test_file_ptfi');
touch ('SplFileInfo_getPerms_basic.txt');
chmod('SplFileInfo_getPerms_basic.txt', 0557);
$fileInfo = new SplFileInfo('SplFileInfo_getPerms_basic.txt');
var_dump($fileInfo->getPerms() == 0100557);

?>
--CLEAN--
<?php
unlink('test_file_ptfi');
unlink('SplFileInfo_getPerms_basic.txt');
?>
--EXPECTF--
bool(true)
2 changes: 1 addition & 1 deletion ext/standard/tests/file/fpassthru_variation.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ echo "*** Testing fpassthru() function with files ***\n\n";

echo "--- Testing with different offsets ---\n";

$file_name = dirname(__FILE__)."/passthru.tmp";
$file_name = dirname(__FILE__)."/passthru_variation.tmp";
$file_write = fopen($file_name, "w");
fwrite($file_write, "1234567890abcdefghijklmnopqrstuvwxyz");
fclose($file_write);
Expand Down
8 changes: 4 additions & 4 deletions ext/standard/tests/file/lchown_basic.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ if (!function_exists("posix_getuid")) die("skip no posix_getuid()");
*/

echo "*** Testing lchown() : basic functionality ***\n";
$filename = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'lchown.txt';
$symlink = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'symlink.txt';
$filename = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'lchown_basic.txt';
$symlink = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'lchown_basic_symlink.txt';

$uid = posix_getuid();

Expand All @@ -29,8 +29,8 @@ var_dump( fileowner( $symlink ) === $uid );
--CLEAN--
<?php

$filename = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'lchown.txt';
$symlink = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'symlink.txt';
$filename = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'lchown_basic.txt';
$symlink = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'lchown_basic_symlink.txt';
unlink($filename);
unlink($symlink);

Expand Down
24 changes: 12 additions & 12 deletions ext/standard/tests/file/mkdir-001.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@ mkdir() tests
--FILE--
<?php

var_dump(mkdir("testdir"));
var_dump(mkdir("testdir/subdir"));
var_dump(rmdir("testdir/subdir"));
var_dump(rmdir("testdir"));
var_dump(mkdir("mkdir-001"));
var_dump(mkdir("mkdir-001/subdir"));
var_dump(rmdir("mkdir-001/subdir"));
var_dump(rmdir("mkdir-001"));

var_dump(mkdir("./testdir"));
var_dump(mkdir("./testdir/subdir"));
var_dump(rmdir("./testdir/subdir"));
var_dump(rmdir("./testdir"));
var_dump(mkdir("./mkdir-001"));
var_dump(mkdir("./mkdir-001/subdir"));
var_dump(rmdir("./mkdir-001/subdir"));
var_dump(rmdir("./mkdir-001"));

var_dump(mkdir(dirname(__FILE__)."/testdir"));
var_dump(mkdir(dirname(__FILE__)."/testdir/subdir"));
var_dump(rmdir(dirname(__FILE__)."/testdir/subdir"));
var_dump(rmdir(dirname(__FILE__)."/testdir"));
var_dump(mkdir(dirname(__FILE__)."/mkdir-001"));
var_dump(mkdir(dirname(__FILE__)."/mkdir-001/subdir"));
var_dump(rmdir(dirname(__FILE__)."/mkdir-001/subdir"));
var_dump(rmdir(dirname(__FILE__)."/mkdir-001"));

echo "Done\n";
?>
Expand Down
30 changes: 15 additions & 15 deletions ext/standard/tests/file/mkdir-002.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,24 @@ if (substr(PHP_OS, 0, 3) == 'WIN') {
--FILE--
<?php

var_dump(mkdir("testdir", 0777));
var_dump(mkdir("testdir/subdir", 0777));
var_dump(`ls -l testdir`);
var_dump(rmdir("testdir/subdir"));
var_dump(rmdir("testdir"));
var_dump(mkdir("mkdir-002", 0777));
var_dump(mkdir("mkdir-002/subdir", 0777));
var_dump(`ls -l mkdir-002`);
var_dump(rmdir("mkdir-002/subdir"));
var_dump(rmdir("mkdir-002"));

var_dump(mkdir("./testdir", 0777));
var_dump(mkdir("./testdir/subdir", 0777));
var_dump(`ls -l ./testdir`);
var_dump(rmdir("./testdir/subdir"));
var_dump(rmdir("./testdir"));
var_dump(mkdir("./mkdir-002", 0777));
var_dump(mkdir("./mkdir-002/subdir", 0777));
var_dump(`ls -l ./mkdir-002`);
var_dump(rmdir("./mkdir-002/subdir"));
var_dump(rmdir("./mkdir-002"));

var_dump(mkdir(dirname(__FILE__)."/testdir", 0777));
var_dump(mkdir(dirname(__FILE__)."/testdir/subdir", 0777));
$dirname = dirname(__FILE__)."/testdir";
var_dump(mkdir(dirname(__FILE__)."/mkdir-002", 0777));
var_dump(mkdir(dirname(__FILE__)."/mkdir-002/subdir", 0777));
$dirname = dirname(__FILE__)."/mkdir-002";
var_dump(`ls -l $dirname`);
var_dump(rmdir(dirname(__FILE__)."/testdir/subdir"));
var_dump(rmdir(dirname(__FILE__)."/testdir"));
var_dump(rmdir(dirname(__FILE__)."/mkdir-002/subdir"));
var_dump(rmdir(dirname(__FILE__)."/mkdir-002"));

echo "Done\n";
?>
Expand Down
18 changes: 9 additions & 9 deletions ext/standard/tests/file/mkdir-003.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@ recursive mkdir() tests
--FILE--
<?php

var_dump(mkdir("testdir/subdir", 0777, true));
var_dump(rmdir("testdir/subdir"));
var_dump(rmdir("testdir"));
var_dump(mkdir("mkdir-003/subdir", 0777, true));
var_dump(rmdir("mkdir-003/subdir"));
var_dump(rmdir("mkdir-003"));

var_dump(mkdir("./testdir/subdir", 0777, true));
var_dump(rmdir("./testdir/subdir"));
var_dump(rmdir("./testdir"));
var_dump(mkdir("./mkdir-003/subdir", 0777, true));
var_dump(rmdir("./mkdir-003/subdir"));
var_dump(rmdir("./mkdir-003"));

var_dump(mkdir(dirname(__FILE__)."/testdir/subdir", 0777, true));
var_dump(rmdir(dirname(__FILE__)."/testdir/subdir"));
var_dump(rmdir(dirname(__FILE__)."/testdir"));
var_dump(mkdir(dirname(__FILE__)."/mkdir-003/subdir", 0777, true));
var_dump(rmdir(dirname(__FILE__)."/mkdir-003/subdir"));
var_dump(rmdir(dirname(__FILE__)."/mkdir-003"));

echo "Done\n";
?>
Expand Down
14 changes: 7 additions & 7 deletions ext/standard/tests/file/tempnam_variation5.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ if(substr(PHP_OS, 0, 3) == "WIN")
$file_path = dirname(__FILE__);

echo "*** Test tempnam() function: by passing an existing filename as prefix ***\n";
$dir_name = $file_path."/tempnam_variation6";
$dir_name = $file_path."/tempnam_variation5";
mkdir($dir_name);
$h = fopen($dir_name."/tempnam_variation6.tmp", "w");
$h = fopen($dir_name."/tempnam_variation5.tmp", "w");

for($i=1; $i<=3; $i++) {
echo "-- Iteration $i --\n";
$created_file = tempnam("$dir_name", "tempnam_variation6.tmp");
$created_file = tempnam("$dir_name", "tempnam_variation5.tmp");

if( file_exists($created_file) ) {
echo "File name is => ";
Expand All @@ -35,18 +35,18 @@ for($i=1; $i<=3; $i++) {
unlink($created_file);
}
fclose($h);
unlink($dir_name."/tempnam_variation6.tmp");
unlink($dir_name."/tempnam_variation5.tmp");
rmdir($dir_name);

echo "\n*** Done ***\n";
?>
--EXPECTF--
*** Test tempnam() function: by passing an existing filename as prefix ***
-- Iteration 1 --
File name is => %stempnam_variation6%etempnam_variation6.tmp%s
File name is => %stempnam_variation5%etempnam_variation5.tmp%s
-- Iteration 2 --
File name is => %stempnam_variation6%etempnam_variation6.tmp%s
File name is => %stempnam_variation5%etempnam_variation5.tmp%s
-- Iteration 3 --
File name is => %stempnam_variation6%etempnam_variation6.tmp%s
File name is => %stempnam_variation5%etempnam_variation5.tmp%s

*** Done ***
2 changes: 1 addition & 1 deletion ext/standard/tests/file/touch_basic.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ if (substr(PHP_OS, 0, 3) == 'WIN') {

echo "*** Testing touch() : basic functionality ***\n";

$filename = dirname(__FILE__)."/touch.dat";
$filename = dirname(__FILE__)."/touch_basic.dat";

echo "\n--- testing touch creates a file ---\n";
@unlink($filename);
Expand Down
2 changes: 1 addition & 1 deletion ext/standard/tests/file/touch_variation2.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Dave Kelsey <[email protected]>
<?php


$filename = dirname(__FILE__)."/touch.dat";
$filename = dirname(__FILE__)."/touch_variation2.dat";
$fp=fopen($filename,"w");
fwrite ($fp,"mydata");
fclose($fp);
Expand Down
2 changes: 1 addition & 1 deletion ext/xmlreader/tests/003.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ XMLReader: libxml2 XML Reader, attributes test
--FILE--
<?php
/* $Id$ */
$filename = dirname(__FILE__) . '/_002.xml';
$filename = dirname(__FILE__) . '/_003.xml';

$xmlstring = '<?xml version="1.0" encoding="UTF-8"?>
<books><book num="1" idx="2">book1</book></books>';
Expand Down
2 changes: 1 addition & 1 deletion ext/xmlreader/tests/004.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ XMLReader: libxml2 XML Reader, attributes test
--FILE--
<?php
/* $Id$ */
$filename = dirname(__FILE__) . '/_002.xml';
$filename = dirname(__FILE__) . '/_004.xml';

$xmlstring = '<?xml version="1.0" encoding="UTF-8"?>
<books><book num="1" idx="2">book1</book></books>';
Expand Down
2 changes: 1 addition & 1 deletion ext/xmlreader/tests/007.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ XMLReader: libxml2 XML Reader, setRelaxNGSchema

$xmlstring = '<TEI.2>hello</TEI.2>';
$relaxngfile = dirname(__FILE__) . '/relaxNG.rng';
$file = dirname(__FILE__) . '/__007.xml';
$file = dirname(__FILE__) . '/_007.xml';
file_put_contents($file, $xmlstring);

$reader = new XMLReader();
Expand Down
2 changes: 1 addition & 1 deletion ext/xmlreader/tests/008.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ $xmlstring = '<?xml version="1.0" encoding="UTF-8" standalone="no"?>
</LIST>';

$dtdfile = rawurlencode(dirname(__FILE__)) . '/dtdexample.dtd';
$file = dirname(__FILE__) . '/__008.xml';
$file = dirname(__FILE__) . '/_008.xml';
file_put_contents($file, $xmlstring);


Expand Down
4 changes: 2 additions & 2 deletions ext/xmlreader/tests/012.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ $reader->close();

echo "\nUsing URI:\n";
$reader = new XMLReader();
$file = dirname(__FILE__) . '/012.xml';
$file = dirname(__FILE__) . '/_012.xml';
if (DIRECTORY_SEPARATOR == '\\') {
$file = str_replace('\\',"/", $file);
}
Expand All @@ -52,7 +52,7 @@ var_dump($reader->getAttribute('baz'));
$reader->close();

$reader = new XMLReader();
$reader->open(dirname(__FILE__) . '/012.xml');
$reader->open(dirname(__FILE__) . '/_012.xml');
$reader->setParserProperty(XMLReader::DEFAULTATTRS, true);
while($reader->read() && $reader->nodeType != XMLReader::ELEMENT);
var_dump($reader->getAttribute('bar'));
Expand Down
4 changes: 4 additions & 0 deletions ext/zlib/tests/bug61139.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,9 @@ if (!extension_loaded('zlib')) {
<?php

gzopen('someFile', 'c');
--CLEAN--
<?php
unlink('someFile');
?>
--EXPECTF--
Warning: gzopen(): gzopen failed in %s on line %d
4 changes: 2 additions & 2 deletions ext/zlib/tests/gzseek_basic2.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ if (!extension_loaded("zlib")) {
?>
--FILE--
<?php
$f = "temp3.txt.gz";
$f = "gzseek_basic2.gz";
$h = gzopen($f, 'w');
$str1 = "This is the first line.";
$str2 = "This is the second line.";
Expand Down Expand Up @@ -39,4 +39,4 @@ reading the output file
This is the first line.
string(40) "0000000000000000000000000000000000000000"
This is the second line.
===DONE===
===DONE===
4 changes: 2 additions & 2 deletions ext/zlib/tests/gzseek_variation1.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ if (!extension_loaded("zlib")) {
?>
--FILE--
<?php
$f = "temp3.txt.gz";
$f = "gzseek_variation1.gz";
$h = gzopen($f, 'w');
$str1 = "This is the first line.";
$str2 = "This is the second line.";
Expand All @@ -30,4 +30,4 @@ unlink($f);
This is the first line.
string(40) "0000000000000000000000000000000000000000"
This is the second line.
===DONE===
===DONE===
4 changes: 2 additions & 2 deletions ext/zlib/tests/gzseek_variation4.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ if (!extension_loaded("zlib")) {
?>
--FILE--
<?php
$f = "temp3.txt.gz";
$f = "gzseek_variation5.gz";
$h = gzopen($f, 'w');
$str1 = "This is the first line.";
$str2 = "This is the second line.";
Expand Down Expand Up @@ -39,4 +39,4 @@ reading the output file
This is the first line.
string(40) "0000000000000000000000000000000000000000"
This is the second line.
===DONE===
===DONE===
4 changes: 2 additions & 2 deletions ext/zlib/tests/gzseek_variation5.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ if (!extension_loaded("zlib")) {
?>
--FILE--
<?php
$f = "temp3.txt.gz";
$f = "gzseek_variation5.gz";
$h = gzopen($f, 'w');
$str1 = "This is the first line.";
$str2 = "This is the second line.";
Expand Down Expand Up @@ -39,4 +39,4 @@ reading the output file
This is the first line.
string(40) "0000000000000000000000000000000000000000"
This is the second line.
===DONE===
===DONE===
4 changes: 2 additions & 2 deletions ext/zlib/tests/gzseek_variation7.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ if (!extension_loaded("zlib")) {
?>
--FILE--
<?php
$f = "temp3.txt.gz";
$f = "gzseek_variation7.gz";
$h = gzopen($f, 'w');
$str1 = "This is the first line.";
$str2 = "This is the second line.";
Expand Down Expand Up @@ -44,4 +44,4 @@ tell=int(47)

reading the output file
This is the first line.This is the second line.
===DONE===
===DONE===