H
H
HaruAtari2014-01-28 08:00:44
PHP
HaruAtari, 2014-01-28 08:00:44

Is it possible to run PPHUnit in different modes?

Good afternoon.
I write tests for the application. I use PHPUnit for this. The application has a number of functions that send sms messages. I run tests often, but you have to pay for messages. But testing of these functions can only be done before the release. Therefore, I would like to run them only when necessary.
Please tell me if it is possible to run phpunit in different modes. Pass keys at startup or something like that. And then in the tests to check if the key is passed - run a certain test. Otherwise, skip it.

Answer the question

In order to leave comments, you need to log in

4 answer(s)
O
OnYourLips, 2014-01-28
@OnYourLips

If this is a unittest, then you need to use the FIRST principle. I - isolated. Apply mocks and stubs for all used classes.
If the test is integration - then use an alternative SMS-gate address, free of charge.
FIRST.jpg

V
vxSPiRiTvx, 2014-01-28
@vxSPiRiTvx

You can divide the tests into 2 folders and test only one for now, and before the release, test the 2nd with sending SMS. Or you can write 2 configuration xml files. You can read about it here - phpunit.de/manual/current/en/organizing-tests.html...

Y
Yakov Akulov, 2014-01-28
@jakulov

I use Mock` and
habrahabr.ru/post/140217 for such cases

S
Sergey Beresnev, 2014-01-28
@sectus

You can use groups:
phpunit.de/manual/3.7/en/appendixes.annotations.ht...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question