php-src/ext/spl/tests/SplFileInfo_getExtension_basic.phpt
Gabriel Caruso ded3d984c6 Use EXPECT instead of EXPECTF when possible
EXPECTF logic in run-tests.php is considerable, so let's avoid it.
2018-02-20 21:53:48 +01:00

31 lines
674 B
PHP

--TEST--
SPL: SplFileInfo::getExtension() basic test
--FILE--
<?php
$file = md5('SplFileInfo::getExtension');
$exts = array('.txt', '.extension', '..', '.', '');
foreach ($exts as $ext) {
touch($file . $ext);
$info = new SplFileInfo($file . $ext);
var_dump($info->getExtension(), pathinfo($file . $ext, PATHINFO_EXTENSION));
}
?>
--CLEAN--
<?php
$file = md5('SplFileInfo::getExtension');
$exts = array('.txt', '.extension', '..', '.', '');
foreach ($exts as $ext) {
unlink($file . $ext);
}
?>
--EXPECT--
string(3) "txt"
string(3) "txt"
string(9) "extension"
string(9) "extension"
string(0) ""
string(0) ""
string(0) ""
string(0) ""
string(0) ""
string(0) ""