Skip to content

lkovace18/entity-factory

Folders and files

NameName
Last commit message
Last commit date
May 6, 2018
Oct 2, 2018
Oct 2, 2018
May 6, 2018
May 6, 2018
May 6, 2018
May 6, 2018
Oct 10, 2017
May 6, 2018
May 6, 2018
May 6, 2018
May 6, 2018

Repository files navigation

Symfony Entity factory

Usage

How to use

Create Entity

$factory->create(User::class);

Create multiple entities

$factory->times(10)->create(Beer::class);

/* This will generate 10 persisted beers with fake values */

Create Entity and override some data

$user = $factory->create(
    User::class, 
    [
        'username' => 'BadassAdmin'
        'active'   => true
    ]
);

Create new instance

$post = $factory->make(User::class)

Get fake values for an entity

Maybe you don't want an instance of the entity, but need some fake data to create you entity object. The values method will return an array of fake values for an entity.

$productData = $factory->values(User::class);

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages