orm icon indicating copy to clipboard operation
orm copied to clipboard

Factory for testing missing afterCreatingState method.

Open Jameron opened this issue 5 years ago • 1 comments

Please prefix your issue with one of the following: [BUG] [PROPOSAL] [QUESTION].

Package version, Laravel version

    "laravel-doctrine/orm": "1.4.7",
    "laravel/lumen-framework": "5.6.*",

Expected behaviour

Want to be able to create factories that are able to create associations that depend on prior models. E.g.

$factory ->state(App\User::class, 'with_posts', []) ->afterCreatingState(App\User::class, 'with_posts', function ($user, $faker, $config) { factory(App\Post::class, $config->get('posts_count', 5))->create([ 'user_id' => $user->id, ]); });

Actual behaviour

afterCreatingState method is missing.

Steps to reproduce the behaviour

Try calling ->afterCreatingState

Jameron avatar May 17 '19 22:05 Jameron

There's a merge request that will resolve this. #363

garret-gunter avatar May 20 '19 18:05 garret-gunter