BigAndini / ers

Event Registration System
GNU General Public License v2.0
10 stars 6 forks source link

Reset database for testing purposes #720

Open BigAndini opened 8 years ago

BigAndini commented 8 years ago

It would be great if it's possible to reset the database and load a specific sql file before special scenarios are tested with behat and mink.

In general there is a directory called Features in each module, see PreReg. In there you can find a directory Context which contains a file FeatureContext.php. It should be possible to load the doctrine stuff in there and do what is possible with vendor/bin/doctrine-module:

  1. vendor/bin/doctrine-module orm:schema-tool:drop
  2. vendor/bin/doctrine-module orm:schema-tool:create
  3. vendor/bin/doctrine-module dbal:import feature-test-1.sql

If this is possible we can prepare sql files which have the needed insert statements to prepare the system to run specific tests, i.e. try to create a user that already exists.

BigAndini commented 8 years ago

Hi @odegroot, can you have a look if you can manage it do get doctrine available in the FeatureContext.php of the testing suite?

BigAndini commented 8 years ago

For further development especially of all the profile functions this is mandatory because otherwise testers need to really test every case in logged in and logged out status. With this in place we could automate these testings.