tmpfile
laravel/framework
Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Creates a temporary file
tmpfile
():
resource
|
false
return
$this
->
createWithContent
(
$name
,
$kilobytes
);
}
return
tap
(new
File
(
$name
,
tmpfile
()), function (
$file
) use (
$kilobytes
,
$mimeType
) {
$file
->
sizeToReport
=
$kilobytes
*
1024
;
$file
->
mimeTypeToReport
=
$mimeType
;
});
src/Illuminate/Http/Testing/FileFactory.php
public function
createWithContent
(
$name
,
$content
)
{
$tmpfile
=
tmpfile
();
fwrite
(
$tmpfile
,
$content
);
src/Illuminate/Http/Testing/FileFactory.php
protected function
generateImage
(
$width
,
$height
,
$extension
)
{
return
tap
(
tmpfile
(), function (
$temp
) use (
$width
,
$height
,
$extension
) {
ob_start
();
$extension
=
in_array
(
$extension
, [
'jpeg'
,
'png'
,
'gif'
,
'webp'
,
'wbmp'
,
'bmp'
])
src/Illuminate/Http/Testing/FileFactory.php
public function
jsonErrorDataProvider
()
{
$resource
=
tmpfile
();
$recursiveObject
= new
stdClass
;
tests/Http/HttpJsonResponseTest.php