Testing your e-commerce PHP application


I'm participating (as much as possible) in the #30daysoftesting challenge organised by Ministry of Testing and SauceLabs. If you're interested, read the full 30 Days of E-Commerce Testing article and join this fun and educational challenge.

The 2nd challenge on the list was to read and share interesting blog articles about E-commerce testing. Since I'm working as a PHP professional I thought it would be great if I oriented my focus on testing PHP based E-commerce platforms. I picked WooCommerce as it's an easy to install and use E-commerce solution. For Magento, PrestaShop and others I've added useful links at the bottom of this article.


WooCommerce Homepage

WooCommerce is an add-on for WordPress, allowing you to integrate E-commerce functionality directly within your blog. This ensures you can be up-and-running in no-time. Even though WooCommerce and WordPress are very active community-driven projects, they both suffer from legacy that has been carried along with WordPress since it's origin: it wasn't build with testing in mind.

Don't get me wrong, the latest versions of WooCommerce and WordPress have unit tests, but their users and integration community was never engaged to automate tests or have taken on a habit of testing. Both platforms come equipped with all the tools required for automated testing when you check out the development code. Production code for the general public do not include these tests. Maybe that's why there's not such a testing culture on these projects.

WordPress PHPUnit tests
Running PHPUnit tests on WordPress Core

If you like to know more about testing WordPress (and fixing bugs), check out their "Make WordPress Core Handbook" as it will give you step-by-step instructions how to get started testing WordPress.

On top of WordPress sits WooCommerce as a plugin (or add-on). Where WordPress offers a step-by-step guide to prepare for testing, WooCommerce offers a Core Testing Guide on their GitHub Wiki. Setting your environment up for testing WooCommerce is a little bit tricky following their guide only, but luckily Jon Moore has a detailed blog article written for unit and end-to-end testing WooCommerce that you can use as a guide to automatically test your WooCommerce application.

WooCommerce PHPUnit tests
Running PHPUnit tests on WooCommerce

Other PHP E-commerce platforms

As mentioned earlier, there are several other E-commerce platforms besides WooCommerce on WordPress: Magento, PrestaShop, OpenCart, Sylius, Aimeos and many more. I'm not going in detail about their functionality and features, instead I'm more interested in their testing culture and how they allow developers and users to automate their tests.

Magento Testing Resources

PrestaShop Testing Resources

We see that these mentioned E-commerce projects are seeing the importance of testing and are working hard to improve their code coverage. After all, it's in their best interest to ensure that their users can sell and ship products and get paid in return for their products and/or services. Nobody wants to loose money.

But we also see that the adaption of tests by users, integrators or hosting companies is not their primary focus. Doing research to get started with testing a commercial web application is not easy, articles are often out-dated or incomplete. 

Hopefully with this #30daysoftesting initiative by Ministry of Testing and SauceLabs we can get more involvement from the community in testing their E-commerce solutions and make these platforms more robust and resilient.

What are your thoughts? Leave your comments and thoughts below or when communicating over social media use the hashtag #30daysoftesting.


Popular Posts