Now that we have a test structure in place, you might be asking yourself "what sort of tests should I be writing?" I've attached a screenshot of my preferences The custom testsuites elements will become apparent once I explain how I structured my tests.įor those interested in a detailed breakdown of the XML config, there are some detailed documentation at. The one I've attached is a fairly basic one, with custom testsuites defined being the main difference. The default configuration file is a XML file that defines certain basic variables that PHPUnit in order to function. The Custom Autoloader needs to point to autoload.php for Composer (hence my earlier pre-requisite of installing Phpunit via Composer). ![]() The trick was to configure PHPStorm (in preferences) to use a Custom Autoloader that you specify and also define a default configuration file, both which were not apparent to me with the available documentation I could find. The documentation surrounding this was unclear or unspecific at best. Rather than writing a single monolithic post, I will write several posts covering different topics. I found some parts of it leaving me with unanswered questions, so I'm hoping this post will supplement any questions that you might encounter. Prerequisites : It is assumed Phpunit ( ) is installed via Composer, Selenium ( ) and Php-webdriver for Selenium ( ) is preinstalled.įor Phpstorm users, there's a fairly detailed installation and unit testing instructions here ( ) I'm by no means an expert on phpunit or selenium but I had to jump through a few hoops to get it working (especially with PHPStorm), so I thought I figured I should share my experiences with the community.Īlso, I'm hoping non Phpstorm users can still pick something up useful in this post. I noticed there's hardly any discussion about testing in these forums so I decided to write this quick primer to get some discussion going. ![]() I'm writing this to give back something to the community that has given so much up front over the past year.
0 Comments
Leave a Reply. |