FileMock
class FileMock
In-memory stream wrapper for testing file operations without touching the filesystem.
Constants
| private Protocol |
|
Properties
| static array<string,string> | $files | ||
| resource | $context |
Methods
static string
create(string $content = '', string|null $extension = null)
Creates an in-memory virtual file with the given content and returns its mock:// URL.
static void
register()
No description
bool
stream_open(string $path, string $mode)
No description
false|string
stream_read(int $length)
No description
false|int
stream_write(string $data)
No description
int
stream_tell()
No description
bool
stream_eof()
No description
bool
stream_seek(int $offset, int $whence)
No description
bool
stream_truncate(int $size)
No description
bool
stream_set_option(int $option, int $arg1, int $arg2)
No description
array
stream_stat()
No description
array|false
url_stat(string $path, int $flags)
No description
bool
stream_lock(int $operation)
No description
bool
stream_metadata(string $path, int $option, mixed $value)
No description
bool
unlink(string $path)
No description
Details
at line 38
static string
create(string $content = '', string|null $extension = null)
Creates an in-memory virtual file with the given content and returns its mock:// URL.
at line 49
static void
register()
No description
at line 57
bool
stream_open(string $path, string $mode)
No description
at line 90
false|string
stream_read(int $length)
No description
at line 103
false|int
stream_write(string $data)
No description
at line 118
int
stream_tell()
No description
at line 124
bool
stream_eof()
No description
at line 130
bool
stream_seek(int $offset, int $whence)
No description
at line 148
bool
stream_truncate(int $size)
No description
at line 160
bool
stream_set_option(int $option, int $arg1, int $arg2)
No description
at line 167
array
stream_stat()
No description
at line 174
array|false
url_stat(string $path, int $flags)
No description
at line 182
bool
stream_lock(int $operation)
No description
at line 188
bool
stream_metadata(string $path, int $option, mixed $value)
No description
at line 197
bool
unlink(string $path)
No description