Seeder improvement in Laravel5 Module (#3552) #3630

Merged
merged 2 commits into from Oct 24, 2016

Conversation

Projects
None yet
2 participants
@Bouhnosaure
Contributor

Bouhnosaure commented Oct 21, 2016

Hello again,
I've made a more simple way for seeding the database.
So now you can set these parameters in the config file :

class_name: FunctionalTester
modules:
    enabled:
        - Laravel5:
            run_database_migrations: true      # not required to run seeding
            run_database_seeder: true          # required to use this feature
            database_seeder_class:             # not required ( must be an array )
            - UserTableSeeder
            - AnotherTableSeeder

If you didn't specify any seeder, the default DatabaseSeeder will be used.
Seeders are runned in the order of the array.

@janhenkgerritsen what do you think ?

@janhenkgerritsen

This comment has been minimized.

Show comment
Hide comment
@janhenkgerritsen

janhenkgerritsen Oct 21, 2016

Contributor

Thanks for improving your PR. This is already a lot better, but I still have one request for a change.

The database_seeder_class option should just accept a single class name and not an array. This brings it more in line with how Laravel uses seeders, you specify a single seeder class and can call additional seeders from that class. Check out the relevant section in Laravel's documentation: https://laravel.com/docs/5.3/seeding#calling-additional-seeders

Contributor

janhenkgerritsen commented Oct 21, 2016

Thanks for improving your PR. This is already a lot better, but I still have one request for a change.

The database_seeder_class option should just accept a single class name and not an array. This brings it more in line with how Laravel uses seeders, you specify a single seeder class and can call additional seeders from that class. Check out the relevant section in Laravel's documentation: https://laravel.com/docs/5.3/seeding#calling-additional-seeders

@Bouhnosaure

This comment has been minimized.

Show comment
Hide comment
@Bouhnosaure

Bouhnosaure Oct 22, 2016

Contributor

@janhenkgerritsen, i've corrected my PR, now it accept only one classe name instead of an array.
i hope it's better now !

Thanks !

Contributor

Bouhnosaure commented Oct 22, 2016

@janhenkgerritsen, i've corrected my PR, now it accept only one classe name instead of an array.
i hope it's better now !

Thanks !

@janhenkgerritsen janhenkgerritsen merged commit 300de0d into Codeception:2.2 Oct 24, 2016

3 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
semaphoreci The build passed on Semaphore.
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment