samedi 4 juillet 2020

How to setup an tear down a Integration test with a sheard development Database?

Enviroment: PHP7, Pear, MySQl, PhpUnit

Enviroment to the Problem: In our team, each developer has his own software branch, but all of us work on the same database.

I've developed a new class which load data from our sheared database and do some stuff with this data. To get a better performance i do some goup, count and sum processes on the database.

The "query" is build by PEAR, so i use a ORM.

I have to run the business process manual - do some orders, and devlivery - on the UI, and than I can run my test to compare the result. If another create a my test will fail.

For me it's clear, that this cases of test are integration tests.

Now my Question: Is there an other was than to insert a big query with data at the test-setup and delete the testdata at the test-teardown? Is there to use a plain SQL?

Aucun commentaire:

Enregistrer un commentaire