class FileFactory (View source)

Methods

create(string $name, string|int $kilobytes = 0, string|null $mimeType = null)

Create a new fake file.

createWithContent(string $name, string $content)

Create a new fake file with content.

image(string $name, int $width = 10, int $height = 10)

Create a new fake image.

resource
generateImage(int $width, int $height, string $type)

Generate a dummy image of the given width and height.

Details

File create(string $name, string|int $kilobytes = 0, string|null $mimeType = null)

Create a new fake file.

Parameters

string $name
string|int $kilobytes
string|null $mimeType

Return Value

File

File createWithContent(string $name, string $content)

Create a new fake file with content.

Parameters

string $name
string $content

Return Value

File

File image(string $name, int $width = 10, int $height = 10)

Create a new fake image.

Parameters

string $name
int $width
int $height

Return Value

File

protected resource generateImage(int $width, int $height, string $type)

Generate a dummy image of the given width and height.

Parameters

int $width
int $height
string $type

Return Value

resource