1
0
mirror of https://github.com/php/php-src.git synced 2026-04-11 10:03:18 +02:00
Files
archived-php-src/ext/spl/tests/fileobject_005.phpt
Fabien Villepinte a555cc0b3d Clean DONE tags from tests
Remove most of the `===DONE===` tags and its variations.
Keep `===DONE===` if the test output otherwise becomes empty.

Closes GH-4872.
2019-11-07 21:31:47 +01:00

33 lines
584 B
PHP

--TEST--
SPL: SplFileObject truncate tests
--CREDITS--
Mark Ammann
#Hackday Webtuesday 2008-05-24
--FILE--
<?php
set_include_path(dirname(__DIR__));
$path = __DIR__.DIRECTORY_SEPARATOR.'fileobject_005.txt';
touch($path);
$fo = new SplFileObject('tests'.DIRECTORY_SEPARATOR.'fileobject_005.txt', 'w+', true);
$fo->fwrite("blahlubba");
var_dump($fo->ftruncate(4));
$fo->rewind();
var_dump($fo->fgets());
$fo->rewind();
$fo->fwrite("blahlubba");
?>
--CLEAN--
<?php
$path = __DIR__.DIRECTORY_SEPARATOR.'fileobject_005.txt';
unlink($path);
?>
--EXPECTF--
bool(true)
string(4) "blah"