mabasic
1444
7
General

How to migrate a testing database in Laravel 5?

Posted 4 years ago by mabasic

I have setup Codeception and Laravel 5 to work. And they work.

But now, I want to run codeception with a testing database, not local.

So in functional.suite.yml I have:

class_name: FunctionalTester
modules:
    enabled: [Filesystem, FunctionalHelper, Laravel5]
    config:
      Laravel5:
        environment_file: .env.testing

And that works. It loads the values from .env.testing and runs test on testing database.

The problem now is that I want to migrate the testing database before running the tests.

I do php artisan migrate --env=testing but that migrates my local database specified in .env file.

Is there a way to migrate a database different from one specified in .env ?

Please sign in or create an account to participate in this conversation.

Reply to

Use Markdown with GitHub-flavored code blocks.