# 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:

```bash
- app
  - Modules
    - Events
      - Http
        - Controllers
          - EventsController.php
```

Therefore the Test Case file for the Events Controller will be located at:

```bash
- tests
  - Functional
    - Events
      - Http
        - EventsControllerTest.php
```

{% hint style="warning" %}
Do not include the `Controllers` directory within the folder structure of the Test class.
{% endhint %}

{% hint style="success" %}
Ensure that the module name in the `test/Functional` directory matches the exact case of the module in the `app/Modules` directory.&#x20;
{% endhint %}

***Example:***

Controller’s Name:

```bash
EventsController.php
```

Test Case Name:

```bash
EventsControllerTest.php
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.elentra.org/api/automated-testing/functional-tests/creating-a-functional-test-file.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
