1
0
mirror of https://github.com/danog/file.git synced 2024-11-30 04:19:39 +01:00

Add test for read in append mode

This commit is contained in:
Niklas Keller 2022-09-08 21:05:43 +02:00
parent 0c3980004b
commit 915b666c0a
No known key found for this signature in database
GPG Key ID: AFA536ABA90C76A6

View File

@ -86,6 +86,17 @@ abstract class FileTest extends FilesystemTest
$this->assertSame("previousbarfoobaz", $handle->read());
}
public function testReadInAppendMode(): void
{
$path = Fixture::path() . "/read-append";
$this->driver->write($path, 'previous');
$handle = $this->driver->openFile($path, "a+");
$this->assertSame(8, $handle->tell());
$this->assertNull($handle->read());
$this->assertSame(0, $handle->seek(0));
$this->assertSame('previous', $handle->read());
}
public function testReadingToEnd(): void
{
$handle = $this->driver->openFile(__FILE__, "r");