Elentra API
8.0
Search
K

Creating a Functional Test File

Creating a Test File

All functional tests for the API are located under the test/Functional directory. The functional tests directory contains PHP files with the same name as a controller with the suffix “Test”; these are the Test Case files.
Example
The event controller is located at:
- app
- Modules
- Events
- Http
- Controllers
- EventsController.php
Therefore the Test Case file for the Events Controller will be located at:
- tests
- Functional
- Events
- Http
- EventsControllerTest.php
Do not include the Controllers directory within the folder structure of the Test class.
Ensure that the module name in the test/Functional directory matches the exact case of the module in the app/Modules directory.
Example:
Controller’s Name:
EventsController.php
Test Case Name:
EventsControllerTest.php