Hi all,
I would like to run the unit tests that Elgg includes from a scratch installation.
I have downloaded Elgg 2.3.8 on my computer: https://elgg.org/about/getelgg?forward=elgg-2.3.8.zip
After the installation, Elgg is running fine. I have activated the "Develop tool" and I went to the "Unit test" section from the right panel. After click on "Execute" I got this error:
"Some required classes for testing aren't available, please make sure you've installed the Elgg Composer dev-dependencies."
This button is executing this file: ./vendor/elgg/elgg/engine/tests/suite.php, and the classes that are checking are these ones:
"if (!class_exists('TextReporter') || !class_exists('TestSuite'))"
I can´t find those classed, so for that I executed the following on the elgg root folder: composer install
After that I have new subfolders in the vendor folder:
Before the command:
After the command:
At least, after that, I can find a TestCase class here:
I can´t get any further sorry. To be honest, I don´t know very well what I am doing, I only need to run those unit tests on my Elgg 2.3.8 installation. Can someone help me, please?
Thanks a lot in advance.
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.
- Nikolai Shcherbin@rivervanrain
Nikolai Shcherbin - 0 likes
- John.iwt@john.iwt
John.iwt - 0 likes
- iionly@iionly
iionly - 0 likes
- Jerome Bakker@jeabakker
Jerome Bakker - 0 likes
- John.iwt@john.iwt
John.iwt - 0 likes
You must log in to post replies.What about the lateset Elgg 3.3.15?
Thanks for your reply @Nikolai,
Unfortunately, I need to use Elgg 2.3 because is the version implemented for my solution, and I am not thinking of migrating to Elgg 3 yet I am afraid.
So, is there a way to run the unit tests in Elgg 2.3?
Kind regards.
First of all you might better install Elgg from scratch using composer. For Elgg 2 the instructions to install from command line are to be found at https://learn.elgg.org/en/2.3/intro/install.html#upload-elgg. The "composer global require ..." command is no longer necessary on Elgg 3 so you might not have executed it yet.
I've never used the unit test, so I'm not sure what else might be necessary to get it working. But I would guess that you might need to call composer with the --require-dev parameter to get the dev dependencies installed (as mentioned in the error message you posted).
@John.iwt
Please check if you can't upgrade to Elgg 3.x soon because hopefully in Q2 we'll release Elgg 4 and than the support for Elgg 2.3 will drop.
Just so you know.
Don't try to run the unit tests from the site always use the command line. Don't ask why it was implemented as an option on the site. This option has been removed in Elgg 3 and you can only run the unit tests from the command line.
Thanks, guys for your answers.
I will try the installation from scratch for Elgg 2.3 by using composer as suggested by @iionly and let you know.
I will also consider @Jerome answer to not use the option from the site. And also the option of migrating to Elgg 3 soon.