PHPackages                             nimut/testing-framework - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Testing &amp; Quality](/categories/testing)
4. /
5. nimut/testing-framework

Abandoned → [typo3/testing-framework](/?search=typo3%2Ftesting-framework)ArchivedLibrary[Testing &amp; Quality](/categories/testing)

nimut/testing-framework
=======================

TYPO3 testing framework that provides base classes and configuration for PHPUnit tests

6.0.1(4y ago)521.4M—0.8%23[14 issues](https://github.com/Nimut/testing-framework/issues)[2 PRs](https://github.com/Nimut/testing-framework/pulls)20GPL-2.0-or-laterPHPPHP ^7.2 || ^8.0

Since Feb 16Pushed 2y ago6 watchersCompare

[ Source](https://github.com/Nimut/testing-framework)[ Packagist](https://packagist.org/packages/nimut/testing-framework)[ Docs](https://github.com/Nimut/testing-framework)[ RSS](/packages/nimut-testing-framework/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (12)Versions (68)Used By (20)

Testing Framework for TYPO3 CMS Extensions
==========================================

[](#testing-framework-for-typo3-cms-extensions)

There are no plans to support nimut/testing-framework for versions above TYPO3 v11. You are advised to switch to the typo3/testing-framework for TYPO3 v12 and above. The typo3/testing-framework has improved support for testing more than one version of the core. Further information and an introduction can be found in the official TYPO3 documentation:

- [Testing Extensions](https://docs.typo3.org/m/typo3/reference-coreapi/main/en-us/Testing/ExtensionTesting.html)

ℹ️ Show docs for TYPO3 9.5 up to 11.5[![Latest Stable Version](https://camo.githubusercontent.com/ec13ad5f2acc983ba89ffae03789972ac3f8cce3272e5dabd1de1648bf449d37/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6e696d75742f74657374696e672d6672616d65776f726b2e737667)](https://packagist.org/packages/nimut/testing-framework)[![Build Status](https://camo.githubusercontent.com/e567ea5af542efdc9fb7789abc7a715d4bd44ba23ba3aa5c85fa91db6460d4e1/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f4e696d75742f74657374696e672d6672616d65776f726b2f6d61737465722e737667)](https://travis-ci.org/Nimut/testing-framework)[![StyleCI](https://camo.githubusercontent.com/5dc1625dc478b5170e40e7c98d96c34a45ecff130d3e4ee92ff78a865e1f836b/68747470733a2f2f7374796c6563692e696f2f7265706f732f38313939393138342f736869656c643f6272616e63683d6d6173746572)](https://styleci.io/repos/81999184)

The aim of the testing framework is to provide a good way to write and run unit and functional tests for multiple versions of the TYPO3 CMS. Currently **TYPO3 CMS 9.5 up to 11.5** are tested and supported.

Installation
------------

[](#installation)

Use [Composer](https://getcomposer.org/) to install the testing framework.

```
composer require --dev nimut/testing-framework
```

Composer will add the package as a dev requirement to your composer.json and install PHPUnit and vfsStream as its dependencies.

Usage
-----

[](#usage)

### Unit Tests

[](#unit-tests)

Inherit your test class from `\Nimut\TestingFramework\TestCase\UnitTestCase`.

To execute the unit tests of your extension run

```
vendor/bin/phpunit -c vendor/nimut/testing-framework/res/Configuration/UnitTests.xml \
    typo3conf/ext/example_extension/Tests/Unit
```

#### ViewHelper

[](#viewhelper)

For an easy way to test your Fluid ViewHelper you can inherit the test class from `\Nimut\TestingFramework\TestCase\ViewHelperBaseTestcase`.

You should setup your subject class in your setUp() method of the test class:

```
/**
 * @var \PHPUnit_Framework_MockObject_MockObject
 */
protected $viewHelper;

protected function setUp()
{
    parent::setUp();
    $this->viewHelper = $this->getMockBuilder(RenderChildrenViewHelper::class)->setMethods(['renderChildren'])->getMock();
    $this->injectDependenciesIntoViewHelper($this->viewHelper);
    $this->viewHelper->initializeArguments();
}
```

### Functional Tests

[](#functional-tests)

Inherit your test class from `\Nimut\TestingFramework\TestCase\FunctionalTestCase`.

To execute the functional tests of your extension run

```
vendor/bin/phpunit -c vendor/nimut/testing-framework/res/Configuration/FunctionalTests.xml \
    typo3conf/ext/example_extension/Tests/Functional
```

### Extension preparation

[](#extension-preparation)

You can add a script section to your `composer.json` file to symlink your extension to the proper root-dir/web-dir.

```
"scripts": {
    "post-autoload-dump": [
        "@prepare-extension-test-structure"
    ],
    "prepare-extension-test-structure": [
        "Nimut\\TestingFramework\\Composer\\ExtensionTestEnvironment::prepare"
    ]
}
```

### Database abstraction

[](#database-abstraction)

To be able to test against TYPO3 CMS 8 and later, nimut/testing-framework provides an own database abstraction layer.

In your FunctionalTestCase call `$this->getDatabaseConnection()` to get an instance of `\Nimut\TestingFramework\Database\DatabaseInterface`.

Following database functions are built in the nimut/testing-framework database interface:

- select
- selectSingleRow
- selectCount
- insertArray
- lastInsertId
- updateArray
- delete
- getDatabaseInstance

If you need own database requests you can get the proper database instance of the current TYPO3 version by using `$this->getDatabaseConnection()->getDatabaseInstance()`. You have to check weather this instance is a `\TYPO3\CMS\Core\Database\Query\QueryBuilder` (TYPO3 CMS 8 and above) or an instance of `\TYPO3\CMS\Core\Database\DatabaseConnection` (TYPO3 CMS 7).

#### Database fixtures

[](#database-fixtures)

The nimut/testing-framework ships database fixtures for several TYPO3 CMS core database tables:

- pages
- pages\_language\_overlay
- sys\_file\_storage
- sys\_language
- tt\_content

To use the database fixtures you can trigger an import in your test file

```
$this->importDataSet('ntf://Database/pages.xml');
```

### Frontend requests

[](#frontend-requests)

The nimut/testing-framework ships an own TypoScript file for supporting frontend requests out of the box.

```
// First import some page records
$this->importDataSet('ntf://Database/pages.xml');

// Import tt_content record that should be shown on your home page
$this->importDataSet('ntf://Database/tt_content.xml');

// Setup the page with uid 1 and include the TypoScript as sys_template record
$this->setUpFrontendRootPage(1, array('ntf://TypoScript/JsonRenderer.ts'));

// Fetch the frontend response
$response = $this->getFrontendResponse(1);

// Assert no error has occured
$this->assertSame('success', $response->getStatus());

// Get the first section from the response
$sections = $response->getResponseSections();
$defaultSection = array_shift($sections);

// Get the section structure
$structure = $defaultSection->getStructure();

// Make assertions for the structure
$this->assertTrue(is_array($structure['pages:1']['__contents']['tt_content:1']));
```

#### Structure

[](#structure)

The returned structure of a frontend request is an array with some information about your page and its children.

```
[
    // Page for your request
    'pages:1' => [
        'uid' => '1',
        'pid' => '0',
        'sorting' => '0',
        'title' => 'Root',
        // Array with subpages
        '__pages' => [
            'pages:2' => [
                'uid' => '2',
                'pid' => '1',
                'sorting' => '0',
                'title' => 'Dummy 1-2',
            ],
            'pages:5' => [
                'uid' => '5',
                'pid' => '1',
                'sorting' => '0',
                'title' => 'Dummy 1-5',
            ],
        ],
        // Array with content elements
        '__contents' => [
              'tt_content:1' => [
                  'uid' => '1',
                  'pid' => '1',
                  'sorting' => '0',
                  'header' => 'Test content',
                  'sys_language_uid' => '0',
                  'categories' => '0',
              ],
        ],
    ],
]
```

If you need additional information about a record, you can provide additional TypoScript with the needed configuration.

```
// Setup the page with uid 1 and include ntf and own TypoScript
$this->setUpFrontendRootPage(
    1,
    array(
        'ntf://TypoScript/JsonRenderer.ts',
        'EXT:example_extension/Tests/Functional/Fixtures/TypoScript/Config.ts'
    )
);
```

Content of the TypoScript file *Config.ts*

```
config.watcher.tableFields.tt_content = uid,_ORIG_uid,_LOCALIZED_UID,pid,sorting,sys_language_uid,header,categories,CType,subheader,bodytext

```

Additional information
----------------------

[](#additional-information)

Following links provide documentation and additional information about TYPO3 CMS extension testing

- [Unit tests for dummies](https://de.slideshare.net/cpsitgmbh/unit-tests-for-dummies)
- [How to write functional test](https://wiki.typo3.org/Functional_testing#How_to_write_functional_test.3F)
- [Functional tests with TYPO3](https://de.slideshare.net/cpsitgmbh/functional-tests-with-typo3)
- [Functional tests for dummies](https://de.slideshare.net/cpsitgmbh/functional-tests-for-dummies-65673214)

Last but not least you may ask for further support in the Slack channel "[\#cig-testing](https://typo3.slack.com/messages/cig-testing)".

###  Health Score

50

—

FairBetter than 96% of packages

Maintenance15

Infrequent updates — may be unmaintained

Popularity51

Moderate usage in the ecosystem

Community41

Growing community involvement

Maturity83

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 87.8% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~29 days

Recently: every ~36 days

Total

64

Last Release

1526d ago

Major Versions

3.0.7 → 4.0.02018-06-22

4.1.11 → 5.0.02019-12-19

3.x-dev → 5.0.12020-02-25

4.x-dev → 5.2.02021-01-19

5.3.0 → 6.0.02021-10-21

PHP version history (8 changes)0.3.1PHP &gt;=5.3 &lt; 7.2

3.0.0PHP &lt; 7.3

4.0.0PHP &gt;= 5.5, &lt; 7.3

4.1.5PHP &gt;= 5.5, &lt; 7.4

4.1.10PHP &gt;= 5.5, &lt; 7.5

5.2.0PHP &gt;= 7.0, &lt; 7.5

6.0.0PHP &gt;= 7.2, &lt; 7.5 || ~8.0.0

6.0.1PHP ^7.2 || ^8.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/904370?v=4)[Helmut Hummel](/maintainers/helhum)[@helhum](https://github.com/helhum)

![](https://avatars.githubusercontent.com/u/1453345?v=4)[Nicole Hummel](/maintainers/IchHabRecht)[@IchHabRecht](https://github.com/IchHabRecht)

---

Top Contributors

[![IchHabRecht](https://avatars.githubusercontent.com/u/1453345?v=4)](https://github.com/IchHabRecht "IchHabRecht (360 commits)")[![helhum](https://avatars.githubusercontent.com/u/904370?v=4)](https://github.com/helhum "helhum (32 commits)")[![oliverklee](https://avatars.githubusercontent.com/u/765746?v=4)](https://github.com/oliverklee "oliverklee (7 commits)")[![mbrodala](https://avatars.githubusercontent.com/u/5037116?v=4)](https://github.com/mbrodala "mbrodala (5 commits)")[![simonschaufi](https://avatars.githubusercontent.com/u/941794?v=4)](https://github.com/simonschaufi "simonschaufi (2 commits)")[![Kanti](https://avatars.githubusercontent.com/u/471387?v=4)](https://github.com/Kanti "Kanti (1 commits)")[![sypets](https://avatars.githubusercontent.com/u/13206455?v=4)](https://github.com/sypets "sypets (1 commits)")[![t3easy](https://avatars.githubusercontent.com/u/3628035?v=4)](https://github.com/t3easy "t3easy (1 commits)")[![tomasnorre](https://avatars.githubusercontent.com/u/1212481?v=4)](https://github.com/tomasnorre "tomasnorre (1 commits)")

---

Tags

phpunittestingtypo3typo3-cmstestingphpunitTYPO3 CMS

### Embed Badge

![Health badge](/badges/nimut-testing-framework/health.svg)

```
[![Health](https://phpackages.com/badges/nimut-testing-framework/health.svg)](https://phpackages.com/packages/nimut-testing-framework)
```

###  Alternatives

[typo3/testing-framework

The TYPO3 testing framework provides base classes for unit, functional and acceptance testing.

675.0M775](/packages/typo3-testing-framework)[brianium/paratest

Parallel testing for PHP

2.5k118.8M754](/packages/brianium-paratest)[fluidtypo3/vhs

This is a collection of ViewHelpers for performing rendering tasks that are not natively provided by TYPO3's Fluid templating engine.

1954.1M49](/packages/fluidtypo3-vhs)[fluidtypo3/flux

The flux package from FluidTYPO3

152982.2k20](/packages/fluidtypo3-flux)[pagemachine/typo3-formlog

Form log for TYPO3

23225.3k6](/packages/pagemachine-typo3-formlog)[eliashaeussler/typo3-form-consent

Extension for TYPO3 CMS that adds double opt-in functionality to EXT:form

1481.0k](/packages/eliashaeussler-typo3-form-consent)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
