SupportFlow / supportflow

A WordPress plugin to manage support tickets
90 stars 14 forks source link

Setup PHPUnit test suite #185

Open iandunn opened 10 years ago

iandunn commented 10 years ago

The first area to target will be the e-mail retrieval.

VarunAgw commented 10 years ago

Sorry I am new to unit testing with only some theoritical knowledge only. So what we exactly want to do here?

iandunn commented 10 years ago

There should be lots of tutorials if you do a search. Basically, you want to setup PHPUnit in your local environment, then add a tests/ directory to the plugin that contains the test suite.

You can take a look at Core's test suite for some examples of dealing with mail specifically.

http://develop.svn.wordpress.org/trunk/tests/phpunit/includes/mock-mailer.php http://develop.svn.wordpress.org/trunk/tests/phpunit/tests/mail.php http://develop.svn.wordpress.org/trunk/tests/phpunit/wp-mail-real-test.php