Answer the question
In order to leave comments, you need to log in
How to work with a test environment?
Hello. I can't figure out how to work with env files and tests, in particular, have my own test base.
There is a project on Symfony 5 and Codeception. I would like to run tests, including those working with a database created specifically for tests.
There is a `project` base and a `project_test` base. I created a file .env.test.local
and put it in
APP_ENV=test
DATABASE_URL="mysql://root:[email protected]:3306/project_test"
bin/console doctrine:migrations:migrate --env=test
migrations they end up in `project_test`. But what to do next? If I run `codecept_run` the tests run against the `project` base, not the test base. Where and what should I specify in order to work with the test base? Symphony's documentation$ APP_ENV=test symfony php bin/phpunit tests/Controller/ConferenceControllerTest.php
, but can I just specify APP_ENV=test in env.local.test and have symphony "accept" it, or how does it even work?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question