Hello
I want to set up unit tests for a plugin that I developed on Elgg but I do not really know where to start.
If other people have already put in place, they could advise me.
Is there a plugin that would implement these tests (and documenattion course), if not how to testboth the php code and functions Elgg which obviously are not recognized as a tool phpunit.
Thank you in advance for your help
info@elgg.org
Security issues should be reported to security@elgg.org!
©2014 the Elgg Foundation
Elgg is a registered trademark of Thematic Networks.
Cover image by RaĆ¼l Utrera is used under Creative Commons license.
Icons by Flaticon and FontAwesome.
- ihayredinov@ihayredinov
ihayredinov - 0 likes
- andres.fortier@andres.fortier
andres.fortier - 0 likes
You must log in to post replies.Unit Tests are bundled with the Developer Tools plugin. Core unit tests are in the engine folder I believe, so start there.
I would also search in Elgg's developer google mailing group, there were some things mentioned there. And of course on github.
Hi perezj, we have written a plugin that integrates phpunit with elgg. It's main difference from the current testing approach in the fact that it uses a separate test DB (that get's cleaned on every test) instead of the production one. You can see the details in http://research.quanbit.com/2011/11/10/torwards-a-safe-unit-test-suite-in-elgg/ and http://research.quanbit.com/2011/11/25/installing-qbelggtestsforphpunit/, and download it from http://research.quanbit.com/qbelggtestsforphpunit/
We haven't yet posted the plugin here since I'm currently on medical licence, but we will as soon as I can get back to work.
BTW, I forgot to mention that we also replicated the core tests in our plugin to check that it worked ok.
HTH,
Andrés