---
title: "Running checks & tests"
manual: "TYPO3 EXT:tea"
version: "main"
permalink: "https://docs.typo3.org/permalink/ttn/tea:running-checks-and-tests@main"
source: "TechnicalBackground/Running.rst"
modified: "2026-09-17T10:16:32+00:00"
---

# Running checks & tests

Most code checks and tests can be run via Composer commands.

**Table of Contents:**

-   [Composer scripts](https://docs.typo3.org/permalink/ttn/tea:composer-scripts-1@main)
-   [Running code checks](https://docs.typo3.org/permalink/ttn/tea:running-code-checks-1@main)
-   [Running unit and functional tests](https://docs.typo3.org/permalink/ttn/tea:running-unit-and-functional-tests-1@main)
-   [Running unit and functional tests in PHPStorm](https://docs.typo3.org/permalink/ttn/tea:running-unit-and-functional-tests-in-phpstorm-1@main)

## Composer scripts

For most development-related tasks, this extension provides Composer scripts.
If you are working locally (Composer needs to be installed on your local
machine), you can run them using `composer <scriptname>`.

You can run `composer` or `./Build/Scripts/runTests.sh -s composer` to
display a list of all available Composer commands and scripts. For all custom
Composer scripts there are descriptions in the `script-description` section of
the `composer.json`.

Keep in mind that certain commands only work if you have run
`composer install` or `./Build/Scripts/runTests.sh -s composer install`
before.

If you have problems with missing dependencies on your local machine, it is
recommended to execute tests with the usage of the `runTests.sh` script.

```bash
./Build/Scripts/runTests.sh -s composer check:php:lint
```

This makes your life easier because you
don't have to worry about local dependencies.

> [!NOTE]
> It's always a good idea to look into the `runTests.sh` "Examples" section to
> get an idea how it works. In the "Options" section you can find all
> available options.

## Running code checks

You can currently run these code checks on the command line:

```bash
./Build/Scripts/runTests.sh -s composer check:composer:normalize
```

Checks the composer.json.

```bash
./Build/Scripts/runTests.sh -s composer check:json:lint
```

Lints the JSON files.

```bash
./Build/Scripts/runTests.sh -s composer check:php
```

Runs all static checks for the PHP files.

```bash
./Build/Scripts/runTests.sh -s composer check:php:cs-fixer
```

Checks the code style with the PHP Coding Standards Fixer (PHP-CS-Fixer).

```bash
./Build/Scripts/runTests.sh -s composer check:php:lint
```

Lints the PHP files for syntax errors.

```bash
./Build/Scripts/runTests.sh -p 8.2 -t 13.4 -s phpstan
```

Checks the PHP types using PHPStan. The option `-t` selects the
PHPStan configuration and baseline for the given TYPO3 version
(`13.4` or `14.3`). Use the TYPO3 version the dependencies
have been installed for.

```bash
./Build/Scripts/runTests.sh -s composer check:typoscript:lint
```

Lints the TypoScript files.

```bash
./Build/Scripts/runTests.sh -s composer check:xliff:normalize
```

Checks the formatting of the XLIFF files.

```bash
./Build/Scripts/runTests.sh -s composer check:yaml:lint
```

Lints the YAML files.

```bash
./Build/Scripts/runTests.sh -s fix
```

Runs all fixers (except for the ones that need JavaScript).

```bash
./Build/Scripts/runTests.sh -s composer fix:php
```

Runs all fixers for the PHP code.

```bash
./Build/Scripts/runTests.sh -s composer fix:php:cs-fixer
```

Fixes the code style with PHP-CS-Fixer.

```bash
./Build/Scripts/runTests.sh -s normalizeXliff
```

Normalizes the formatting of the XLIFF files. Add `-n` to only check
the formatting without changing any files.

```bash
./Build/Scripts/runTests.sh -p 8.2 -t 13.4 -s phpstanGenerateBaseline
```

Updates the PHPStan baseline file of the given TYPO3 version to match the
code.

## Running unit and functional tests

> [!NOTE]
> Executing tests on Windows via `runTests.sh` should be done within the
> \[Windows Subsystem for Linux (WSL 2)\]([https://en.wikipedia.org/wiki/Windows_Subsystem_for_Linux](https://en.wikipedia.org/wiki/Windows_Subsystem_for_Linux)).

> [!IMPORTANT]
> Before running any commands you need to install all dependencies with

```bash
./Build/Scripts/runTests.sh -s composer update
```

You can currently run these tests on the command line:

```bash
./Build/Scripts/runTests.sh -t 13.4 -s functional
```

Runs the functional tests using a database populated from the CSV files in
`Tests/Functional/Controller/Fixtures/Database` folder.

> [!NOTE]
> For executing functional tests, a database connection is needed. Therefore,
> it is recommended to run the functional tests using `runTests.sh`.

```bash
./Build/Scripts/runTests.sh -t 13.4 -s unit
```

Runs the unit tests.

> [!TIP]
> With the option `-p`, you can specify which PHP version will be used to
> execute the tests. If you don't specify a PHP version, the default PHP
> version will be used.
>
> ```bash
> ./Build/Scripts/runTests.sh -p 8.2 -s unit
> ```

> [!TIP]
> With the option `-t` (`13.4` or `14.3`, default
> `13.4`), you can specify the TYPO3 version the unit and the
> functional tests are run for. Tests which only apply to one TYPO3 version
> are skipped for the others, and a version the dependencies have not been
> installed for makes the tests fail immediately. Use the same version as for
> the installation.
>
> ```bash
> ./Build/Scripts/runTests.sh -t 14.3 -s unit
> ./Build/Scripts/runTests.sh -t 14.3 -s functional
> ```

## Running unit and functional tests in PHPStorm

### General setup

-   Open **File > Settings > PHP > Test Frameworks**.
-   (\*) Use Composer autoloader.
-   Path to script: select `.Build/vendor/autoload.php` in your project folder.

In the Run configurations, edit the PHPUnit configuration and use these
settings so this configuration can serve as a template:

-   Directory: use the `Tests/Unit` directory in your project.
-   (\*) Use alternative configuration file.
-   Use `.Build/vendor/typo3/testing-framework/Resources/Core/Build/UnitTests.xml`
    in your project folder.
-   Add the following environment variables:

    -   typo3DatabaseUsername
    -   typo3DatabasePassword
    -   typo3DatabaseHost
    -   typo3DatabaseName

### Unit tests configuration

In the Run configurations, copy the PHPUnit configuration and use these
settings:

-   Directory: use the `Tests/Unit` directory in your project

### Functional tests configuration

In the Run configurations, copy the PHPUnit configuration and use these
settings:

-   Directory: use the `Tests/Functional` directory in your project.
-   (\*) Use alternative configuration file.
-   Use
    `.Build/vendor/typo3/testing-framework/Resources/Core/Build/FunctionalTests.xml`.
