Skip to content

Overview

XELOS integrates the popular testing framework Codeception to support the writing of different types of tests. Currently Unit Tests and Functional Tests are begin supported.

XELOS 7.1 supports tests only for the core functions - module specific tests are planned for a future release. All tests are being located in the /tests/ folder of the system.

Running Test

Test can be run using php xf test all. To be able to run a test you must have a working XELOS installation. Furthermore, you need a config.tests.php configuration in your /system/config/ folder. This can be a copy of your config.custom.php file but should be linked to another database as running the tests will wipe the existing database. Make sure that the user and database exists before continuing.

To run tests locally you need composer dev modules installed. Run composer update.

During writing tests it might be helpful to run only a specific test to reduce the waiting time. This can be done by specifying the suite and test file name - e.g. php xf test unit core/xelosDatabaseTest.php or php xf test functional Core/basicFormCheckCest.php

You can see the return of your test in the codeception/_output directory.

Writing Unit Tests

COMING SOON