Fabricator.php
system/Test/Fabricator.php
1 class
23 methods
class Fabricator
Fabricator Bridge class for using Faker to create example data based on model specifications.
__construct
($model, ?array $formatters = null, ?string $locale = null)
resetCounts
()
getCount
(string $table)
setCount
(string $table, int $count)
upCount
(string $table)
downCount
(string $table)
getModel
()
getLocale
()
getFaker
()
getOverrides
()
setOverrides
(array $overrides = [], $persist = true)
setUnique
(string $field, bool $reset = false, int $maxRetries = 10000)
setOptional
(string $field, float $weight = 0.5, mixed $default = null)
setValid
(string $field, ?Closure $validator = null, int $maxRetries = 10000)
getFormatters
()
setFormatters
(?array $formatters = null)
detectFormatters
()
guessFormatter
($field)
make
(?int $count = null)
makeArray
()
makeObject
(?string $className = null)
create
(?int $count = null, bool $mock = false)
createMock
(?int $count = null)