mirror of
https://github.com/php/php-src.git
synced 2026-04-11 10:03:18 +02:00
Remove most of the `===DONE===` tags and its variations. Keep `===DONE===` if the test output otherwise becomes empty. Closes GH-4872.
33 lines
584 B
PHP
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"
|