---
title: "Tests"
version: "2.0"
source: "Contribution/Testing.rst"
rendered: "2026-09-27T13:10:28+00:00"
---

# Tests {#testing}

For tests you first need to prepare a local typo3 instance for testing inside this extensions root folder using composer.

You can install different TYPO3 versions for testing. From inside the extension folder (typo3conf/ext/c1_adaptive_images):

-   for 13.4: `composer require typo3/minimal=^13.4 && git checkout composer.json && rm composer.lock`
-   for 14.3: `composer require typo3/minimal=^14.3 && git checkout composer.json && rm composer.lock`

**Unit** tests require the following environment variables:

```bash
export TYPO3_PATH_APP=$PWD
export TYPO3_PATH_ROOT=$PWD/.Build/public
composer tests:unit
```

**Functional and acceptance tests** require a working mysql database where the testuser is allowed to create tables.
Also some environment variables are required (adapt to your database credentials):

```bash
# export typo3DatabaseName=testing
# export typo3DatabaseUsername=testing
# export typo3DatabasePassword=testing
# export typo3DatabaseHost=127.0.0.1
export typo3DatabaseDriver=pdo_sqlite
export TYPO3_PATH_APP=$PWD
export TYPO3_PATH_ROOT=$PWD/.Build/public
```

## For acceptance tests {#for-acceptance-tests}

you also need to start a local webserver serving from the test-instance. This can be done with
the builtin webserver in php:

```bash
export TYPO3_PATH_APP=$PWD
export TYPO3_PATH_ROOT=$PWD/.Build/public
php -S 127.0.0.1:8888 -t .Build/public/
```

Also selenium or chromedriver is required.

Start chromedriver with:

```bash
chromedriver --url-base=wd/hub
```
