class
Illuminate
/
Http
/
Testing
/
File
You're browsing the documentation for an upcoming version of Laravel. The documentation and features of this release are subject to change.
File
Extends
Properties
public
$name string
The name of the file.
Default: null
public
$tempFile resource
The temporary file resource.
Default: null
public
$sizeToReport int
The "size" to report.
Default: null
public
$mimeTypeToReport string|null
The MIME type to report.
Default: null
Methods
public
__construct ( $name , $tempFile ) : void
Create a new file instance.
Parameters
- $name string
- $tempFile resource
public
static
create ( $name , $kilobytes ) : File
Create a new fake file.
Parameters
- $name string
- $kilobytes string|int
public
static
createWithContent ( $name , $content ) : File
Create a new fake file with content.
Parameters
- $name string
- $content string
public
static
image ( $name , $width , $height ) : File
Create a new fake image.
Parameters
- $name string
- $width int
- $height int
public
size ( $kilobytes ) : $this
Set the "size" of the file in kilobytes.
Parameters
- $kilobytes int
public
getSize ( ) : int
Get the size of the file.
public
mimeType ( $mimeType ) : $this
Set the "MIME type" for the file.
Parameters
- $mimeType string
public
getMimeType ( ) : string
Get the MIME type of the file.
protected
tempFilePath ( ) : string
Get the path to the temporary file.