PHPackages                             vierge-noire/cakephp-test-suite-light - 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. vierge-noire/cakephp-test-suite-light

ActiveCakephp-plugin[Testing &amp; Quality](/categories/testing)

vierge-noire/cakephp-test-suite-light
=====================================

A test suite for CakePHP application based on Sql queries

v3.0(2y ago)13902.1k—1.6%7[11 issues](https://github.com/vierge-noire/cakephp-test-suite-light/issues)[4 PRs](https://github.com/vierge-noire/cakephp-test-suite-light/pulls)8MITPHPPHP &gt;=8.1

Since Oct 5Pushed 1y ago2 watchersCompare

[ Source](https://github.com/vierge-noire/cakephp-test-suite-light)[ Packagist](https://packagist.org/packages/vierge-noire/cakephp-test-suite-light)[ RSS](/packages/vierge-noire-cakephp-test-suite-light/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (4)Versions (42)Used By (8)

cakephp-test-suite-light
========================

[](#cakephp-test-suite-light)

A fast test suite for CakePHP applications

#### For CakePHP 5.x

[](#for-cakephp-5x)

composer require --dev vierge-noire/cakephp-test-suite-light "^3.0"

#### For CakePHP 4.x

[](#for-cakephp-4x)

composer require --dev vierge-noire/cakephp-test-suite-light "^2.0"

#### For CakePHP 3.x

[](#for-cakephp-3x)

composer require --dev vierge-noire/cakephp-test-suite-light "^1.0"

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

[](#installation)

### Listeners

[](#listeners)

For CakePHP ^4.3 application, no additional listener is required. See the doc [here](https://book.cakephp.org/4.next/en/appendices/fixture-upgrade.html#fixture-upgrade).

Prior to CakePHP 4.3:

Make sure you *replace* the native CakePHP listener by the following one inside your `phpunit.xml` (or `phpunit.xml.dist`) config file, per default located in the root folder of your application:

```

```

Between each test, the package will truncate all the test tables that have been used during the previous test.

The fixtures will be created in the test database(s) defined in your [configuration](https://book.cakephp.org/4/en/development/testing.html#test-database-setup).

***Important: you should not add the [CakePHP native listener](https://book.cakephp.org/3/en/development/testing.html#phpunit-configuration)*** to your `phpunit.xml` file. Only one listener is required, which is the one described in the section *Installation*.

### Truncating tables

[](#truncating-tables)

#### With CakePHP ^4.3

[](#with-cakephp-43)

Use the `CakephpTestSuiteLight\Fixture\TruncateDirtyTables` trait in a test case class in order to clean up the database prior to each of its tests.

#### Prior to CakePHP ^4.3

[](#prior-to-cakephp-43)

The package will empty by default the dirty tables in all test databases.

If you with to ignore the truncation for a given test case, you may use the `CakephpTestSuiteLight\SkipTablesTruncation` trait

If you wish to ignore a given connection, you may provide the `skipInTestSuiteLight` key to `true` in your `config/app.php`. E.g.:

```
In config/app.php
