4

I´m making a wordpress plugin with PHPStorm. This plugin contains a load of files with addons as well and it´s the time to use unit tests to check up before each commit in my github project.

I took a look about what it exists now to do this like :

  1. The basic PHPUnit
  2. codeception, specificaly with wp-browser
  3. There is wordpress-develop
  4. Selenium for UI

But for my first unit testing, I´m really lost. I would like to test my plugin with process like this :

Test 1 - Admin side

 1. Connection on the admin interface with the admin user
 2. Go to the url : http://my-example.org/wp-admin/options-general.php
 3. Check if the protocol is not https, there is the message : "[My warning as notice to prevent the admin to install the https protocol to use my plugin]"

Test 2 - Front-end side

1. The visitor fill the form to subscribe
2. The visitor do a paypal payment
3. See the result

As you can see, I´m using the protocol https, paypal and the google recaptcha as well that are not really good to test on localhost.

So, someone with experiment could advise me to choose the best way to make unit test on a dev environment online (if it is possible) ?

Which tool is the easiest way to do these kinds of tests in 2018 ?

Notice : My dev environment wordpress is on a shared server.

closed as primarily opinion-based by Tom J Nowell Jun 29 '18 at 15:29

Many good questions generate some degree of opinion based on expert experience, but answers to this question will tend to be almost entirely based on opinions, rather than facts, references, or specific expertise. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 1
    Note that you need to ask your question in such a way that the answer you mark as correct is not just the 'best' for you, but the canonical definitive concretely correct answer, such that anybody who comes across it will find it useful in the "yes that is indeed the way you're meant to do it" way. Although what you described is not a unit test at all, but integration tests. Perhaps that's why your research didn't yield any relevant tools? I'm inclined to close this as a recommendations/shopping question – Tom J Nowell Jun 29 '18 at 1:18
  • @Tom J Nowell - Yes, you´re all right. After looking for that more time, I saw there are 3 kinds of test : unit tests, integration tests and behaviour tests. In fact, a part of them are behaviour tests as well because it depends of user action on the website. I would like so someone share his experiment or justify why in this context this tool could be better than an other one, not a definitive answer. Sometimes, shared opinion (based on experiment) can be a gain of time for others. For me it´s not a "shopping question". – J.BizMai Jun 29 '18 at 13:52
  • Then it sounds like a discussion or a forum thread would be better suited, not that your question isn't good, but it doesn't fit into the Q/A format. E.g. for my own uses I've used Behat for those types of tests, but I've known other devs who swear by other tools – Tom J Nowell Jun 29 '18 at 15:29