mirror of
https://github.com/php/php-src.git
synced 2025-08-18 15:08:55 +02:00
fixed/refactored some spl tests related to owner/group retrieval
This commit is contained in:
parent
6bf101db54
commit
bf61fbb33a
4 changed files with 56 additions and 71 deletions
|
@ -8,23 +8,19 @@ Daniel Londero <daniel.londero@gmail.com>
|
||||||
Francesco Trucchia <ft@ideato.it>
|
Francesco Trucchia <ft@ideato.it>
|
||||||
Jacopo Romei <jacopo@sviluppoagile.it>
|
Jacopo Romei <jacopo@sviluppoagile.it>
|
||||||
#Test Fest Cesena (Italy) on 2009-06-20
|
#Test Fest Cesena (Italy) on 2009-06-20
|
||||||
--SKIPIF--
|
|
||||||
<?php
|
|
||||||
if (substr(PHP_OS, 0, 3) == 'WIN') die("skip this test not for Windows platforms");
|
|
||||||
?>
|
|
||||||
--FILE--
|
--FILE--
|
||||||
<?php
|
<?php
|
||||||
|
$dirname = basename(__FILE__, '.phpt');
|
||||||
shell_exec('mkdir test_dir_ptfi');
|
mkdir($dirname);
|
||||||
$dir = new DirectoryIterator('test_dir_ptfi');
|
$dir = new DirectoryIterator($dirname);
|
||||||
$result = shell_exec('ls -lnd test_dir_ptfi | cut -d" " -f 4');
|
$expected = filegroup($dirname);
|
||||||
|
$actual = $dir->getGroup();
|
||||||
var_dump($dir->getGroup() == $result);
|
var_dump($expected == $actual);
|
||||||
|
|
||||||
?>
|
?>
|
||||||
--CLEAN--
|
--CLEAN--
|
||||||
<?php
|
<?php
|
||||||
rmdir('test_dir_ptfi');
|
$dirname = basename(__FILE__, '.phpt');
|
||||||
|
rmdir($dirname);
|
||||||
?>
|
?>
|
||||||
--EXPECTF--
|
--EXPECTF--
|
||||||
bool(true)
|
bool(true)
|
||||||
|
|
|
@ -1,29 +1,26 @@
|
||||||
--TEST--
|
--TEST--
|
||||||
SPL: Spl Directory Iterator test getOwner
|
SPL: DirectoryIterator test getOwner
|
||||||
--CREDITS--
|
--CREDITS--
|
||||||
Cesare D'Amico <cesare.damico@gruppovolta.it>
|
Cesare D'Amico <cesare.damico@gruppovolta.it>
|
||||||
Andrea Giorgini <agiorg@gmail.com>
|
Andrea Giorgini <agiorg@gmail.com>
|
||||||
Filippo De Santis <fd@ideato.it>
|
Filippo De Santis <fd@ideato.it>
|
||||||
Daniel Londero <daniel.londero@gmail.com>
|
Daniel Londero <daniel.londero@gmail.com>
|
||||||
Francesco Trucchia <ft@ideato.it>
|
Francesco Trucchia <ft@ideato.it>
|
||||||
Jacopo Romei <jacopo@sviluppoagile.it>
|
Jacopo Romei <jacopo@sviluppoagile.it>
|
||||||
#Test Fest Cesena (Italy) on 2009-06-20
|
#Test Fest Cesena (Italy) on 2009-06-20
|
||||||
--SKIPIF--
|
--FILE--
|
||||||
<?php
|
<?php
|
||||||
if (substr(PHP_OS, 0, 3) == 'WIN') die("skip this test not for Windows platforms");
|
$dirname = basename(__FILE__, '.phpt');
|
||||||
?>
|
mkdir($dirname);
|
||||||
--FILE--
|
$dir = new DirectoryIterator($dirname);
|
||||||
<?php
|
$expected = fileowner($dirname);
|
||||||
|
$actual = $dir->getOwner();
|
||||||
shell_exec('mkdir test_dir_ptfi');
|
var_dump($expected == $actual);
|
||||||
$dir = new DirectoryIterator('test_dir_ptfi');
|
|
||||||
$result = shell_exec('ls -lnd test_dir_ptfi | cut -d" " -f 3');
|
|
||||||
var_dump($dir->getOwner() == $result);
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
--CLEAN--
|
--CLEAN--
|
||||||
<?php
|
<?php
|
||||||
rmdir('test_dir_ptfi');
|
$dirname = basename(__FILE__, '.phpt');
|
||||||
?>
|
rmdir($dirname);
|
||||||
--EXPECTF--
|
?>
|
||||||
|
--EXPECTF--
|
||||||
bool(true)
|
bool(true)
|
||||||
|
|
|
@ -1,30 +1,26 @@
|
||||||
--TEST--
|
--TEST--
|
||||||
SPL: Spl File Info test getGroup
|
SPL: SplFileInfo test getGroup
|
||||||
--CREDITS--
|
--CREDITS--
|
||||||
Cesare D'Amico <cesare.damico@gruppovolta.it>
|
Cesare D'Amico <cesare.damico@gruppovolta.it>
|
||||||
Andrea Giorgini <agiorg@gmail.com>
|
Andrea Giorgini <agiorg@gmail.com>
|
||||||
Filippo De Santis <fd@ideato.it>
|
Filippo De Santis <fd@ideato.it>
|
||||||
Daniel Londero <daniel.londero@gmail.com>
|
Daniel Londero <daniel.londero@gmail.com>
|
||||||
Francesco Trucchia <ft@ideato.it>
|
Francesco Trucchia <ft@ideato.it>
|
||||||
Jacopo Romei <jacopo@sviluppoagile.it>
|
Jacopo Romei <jacopo@sviluppoagile.it>
|
||||||
#Test Fest Cesena (Italy) on 2009-06-20
|
#Test Fest Cesena (Italy) on 2009-06-20
|
||||||
--SKIPIF--
|
--FILE--
|
||||||
<?php
|
<?php
|
||||||
if (substr(PHP_OS, 0, 3) == 'WIN') die("skip this test not for Windows platforms");
|
$filename = basename(__FILE__, 'phpt').'tmp';
|
||||||
?>
|
touch($filename);
|
||||||
--FILE--
|
$fileInfo = new SplFileInfo($filename);
|
||||||
<?php
|
$expected = filegroup($filename);
|
||||||
|
$actual = $fileInfo->getGroup();
|
||||||
//file
|
var_dump($expected == $actual);
|
||||||
touch ('test_file_ptfi');
|
|
||||||
$fileInfo = new SplFileInfo('test_file_ptfi');
|
|
||||||
$result = shell_exec('ls -ln test_file_ptfi | cut -d" " -f 4');
|
|
||||||
var_dump($fileInfo->getGroup() == $result);
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
--CLEAN--
|
--CLEAN--
|
||||||
<?php
|
<?php
|
||||||
unlink('test_file_ptfi');
|
$filename = basename(__FILE__, 'phpt').'tmp';
|
||||||
?>
|
unlink($filename);
|
||||||
--EXPECTF--
|
?>
|
||||||
|
--EXPECTF--
|
||||||
bool(true)
|
bool(true)
|
||||||
|
|
|
@ -1,30 +1,26 @@
|
||||||
--TEST--
|
--TEST--
|
||||||
SPL: Spl File Info test getOwner
|
SPL: SplFileInfo test getOwner
|
||||||
--CREDITS--
|
--CREDITS--
|
||||||
Cesare D'Amico <cesare.damico@gruppovolta.it>
|
Cesare D'Amico <cesare.damico@gruppovolta.it>
|
||||||
Andrea Giorgini <agiorg@gmail.com>
|
Andrea Giorgini <agiorg@gmail.com>
|
||||||
Filippo De Santis <fd@ideato.it>
|
Filippo De Santis <fd@ideato.it>
|
||||||
Daniel Londero <daniel.londero@gmail.com>
|
Daniel Londero <daniel.londero@gmail.com>
|
||||||
Francesco Trucchia <ft@ideato.it>
|
Francesco Trucchia <ft@ideato.it>
|
||||||
Jacopo Romei <jacopo@sviluppoagile.it>
|
Jacopo Romei <jacopo@sviluppoagile.it>
|
||||||
#Test Fest Cesena (Italy) on 2009-06-20
|
#Test Fest Cesena (Italy) on 2009-06-20
|
||||||
--SKIPIF--
|
--FILE--
|
||||||
<?php
|
<?php
|
||||||
if (substr(PHP_OS, 0, 3) == 'WIN') die("skip this test not for Windows platforms");
|
$filename = basename(__FILE__, 'phpt').'tmp';
|
||||||
?>
|
touch($filename);
|
||||||
--FILE--
|
$fileInfo = new SplFileInfo($filename);
|
||||||
<?php
|
$expected = fileowner($filename);
|
||||||
|
$actual = $fileInfo->getOwner();
|
||||||
//file
|
var_dump($expected == $actual);
|
||||||
touch ('test_file_ptfi');
|
|
||||||
$fileInfo = new SplFileInfo('test_file_ptfi');
|
|
||||||
$result = shell_exec('ls -ln test_file_ptfi | cut -d" " -f 3');
|
|
||||||
var_dump($fileInfo->getOwner() == $result);
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
--CLEAN--
|
--CLEAN--
|
||||||
<?php
|
<?php
|
||||||
unlink('test_file_ptfi');
|
$filename = basename(__FILE__, 'phpt').'tmp';
|
||||||
?>
|
unlink($filename);
|
||||||
--EXPECTF--
|
?>
|
||||||
|
--EXPECTF--
|
||||||
bool(true)
|
bool(true)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue