PHP Unit, run bench test, test with mocks and test with SQL Lite all together

-1

It is the following personal, working on a huge system, has projects or mini services within a project that we need to test them using Mock, or using PHP database or SQL Lite.

The problem is that for each of these types of tests I have to set different settings in PHPUnit, and I wanted to run these various different test types at once.

That would be possible, if yes could someone give me an example?

    
asked by anonymous 16.10.2017 / 13:29

1 answer

1

You can try to use the setUp() method to set the environment required for testing and the tearDown() method to return the environment to what it was before you started testing. You can find a lot of information in the Capíluto 4 - Environments section of the PHPUnit manual. As for running everything at once if your tests are in the tests directory, for example, you only have to execute the phpunit tests/ command.

    
16.10.2017 / 15:03