PHP Unit, run database test, mock test and SQL Lite test all together

Asked

Viewed 191 times

-1

It’s the following people, work on a huge system, have projects or mini services within a project that we need to test them using Mock, or using PHP’s database or SQL Lite.

The problem is that for each of these test types 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 someone could give me an example ?

  • There are people who negative but do not ask anything does not question anything, moral history, nor should know what I am talking about, and also does not bother to know what it really is. will understand...

1 answer

1


You can try using the method setUp() to set up the environment necessary for carrying out the tests and the method tearDown() to return the environment to what it was before you started testing. You can find a lot of information on Capíluto 4 - Environments from the Phpunit manual. As for running everything at once if your tests are in the directory tests for example, you just run the command phpunit tests/.

  • I’ll take a look here, if it works out I’ll come back and mark your answer.

  • I was able to change the settings using the setup and tearDown, Thank you !

Browser other questions tagged

You are not signed in. Login or sign up in order to post.