
Brief Description
QBElggTestsForPHPUnit is an extension of PHPUnit adapted to create elgg tests. This plugin provides:
- DB independence; the tests never hit the real elgg DB.
- Test independence; each test spawns its own process and calls the elgg engine/start before running.
- Custom fixtures; test cases can define their own fixtures, which are loaded before each test.
Specifications
| Plugin Version: | 0.1 (alpha release) |
| Tested Elgg Versions: |
|
| Prerequisites: |
|
| Authors: |
|
| Contributors: |
|
| Project Hosting: | (Private until beta release) https://bitbucket.org/andres_fortier/qbelggtestsforphpunit |
| Documentation: | For the time being, check for blog posts in the “QBElggTestsForPHPUnit” category |
Want to contribute?
Contributions are vital for Open Source projects and can take many shapes. Here are some more-than-welcome ways of contributing:
- Reporting bugs is one of the best ways for us to improve. In the future we will open an issue tracker, but for the time being you can just email me (andres@quanbit.com).
- Testing in other platforms and notifying us about the results, so that we can expand the plugin specifications (elgg versions, plugin prereqs, etc).
- Proposing and Implementing enhancements so that we can all benefit from collective development.
And of course, if this plugin was useful to you please consider making a donation to keep it growing.
Troubleshooting
As usual with software development, you may encounter problems. Here you can find some hints on solving them.
1. SQL Error while executing SET GLOBAL general_log = ‘ON’
It is possible that when trying to run the metatests (i.e. those tests that are inside the /tests folder) you get an error like this one:
with message "SQL Error while executing 'SET GLOBAL general_log = 'ON'"
Error number:
Error message: "File '/tmp/elgg_test_temporal.log' not found (Errcode: 13)"
in /mod/QBElggTestsForPHPUnit/model/ElggTestDBConnection.php:89
Stack trace:
...
This is basically a permission issue, in particular that mysql can’t access /tmp/elgg_test_temporal.log (see this thread in StackOverflow). To solve this issue you have to:
- Edit the file
/etc/apparmor.d/usr.sbin.mysqld - Add at the end of the file the line
/tmp/elgg_test_temporal.log rw - Restart AppArmor (
sudo /etc/init.d/apparmor reload)
And now you should be able to tun the metatests.
