PHPackages                             authlab/fluent-tester - 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. authlab/fluent-tester

ActiveLibrary[Testing &amp; Quality](/categories/testing)

authlab/fluent-tester
=====================

WordPress testing framework for plugin and theme

01PHP

Since Sep 12Pushed 8mo agoCompare

[ Source](https://github.com/sarkarripon/fluent-tester)[ Packagist](https://packagist.org/packages/authlab/fluent-tester)[ RSS](/packages/authlab-fluent-tester/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Fluent Tester v2.0
==================

[](#fluent-tester-v20)

Modern WordPress testing framework built on **Pest** and **wp-browser** for comprehensive WordPress plugin testing.

Features
--------

[](#features)

- 🧪 **Pest PHP** - Modern, expressive testing syntax
- 🌐 **wp-browser** - Complete WordPress testing environment
- 🔄 **Codeception Integration** - Powerful browser automation and testing modules
- 🎯 **Multi-layer Testing** - Unit, Integration, Functional &amp; Acceptance tests
- 🚀 **WordPress-specific** - Built specifically for WordPress plugin development
- ⚡ **SQLite/MySQL Support** - Choose your database backend
- 📦 **Easy Setup** - One-command environment initialization
- 🔧 **CI/CD Ready** - GitHub Actions and other CI platforms

Requirements
------------

[](#requirements)

- PHP 8.3 or higher
- Composer
- WordPress development environment
- Git (for dependency installation)

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

[](#installation)

Install via Composer as a development dependency:

```
composer require --dev authlab/fluent-tester
```

The post-install script will automatically:

1. Run Codeception bootstrap
2. Execute the initialization script to set up WordPress test environment

### Installing in WordPress projects with composer platform.php pinned (e.g., 7.4)

[](#installing-in-wordpress-projects-with-composer-platformphp-pinned-eg-74)

Some WordPress projects set `composer config platform.php 7.4` for production compatibility. Since Fluent Tester requires PHP 8.1+, Composer may refuse installation. Use one of these approaches:

Option A — temporarily bump platform (preferred)

```
composer config platform.php 8.3
composer require --dev authlab/fluent-tester
# Optionally revert later:
# composer config --unset platform.php
```

Option B — one-off install ignoring platform

```
composer require --dev authlab/fluent-tester --ignore-platform-req=php
```

Option C — developer-only composer file (kept out of VCS)

```
{
  "config": { "platform": { "php": "8.3" } }
}
```

Install using:

```
COMPOSER=composer.local.json composer require --dev authlab/fluent-tester
```

Be sure to git-ignore `composer.local.json`.

Note: Regardless of composer configuration, the runtime PHP used to execute the test suite must be PHP 8.1+.

### Installing in WordPress projects with composer platform.php pinned (e.g., 7.4)

[](#installing-in-wordpress-projects-with-composer-platformphp-pinned-eg-74-1)

Some WordPress projects set `composer config platform.php 7.4` for production compatibility. Since Fluent Tester requires PHP 8.1+, Composer may refuse installation. Use one of these approaches:

Option A — temporarily bump platform (preferred)

```
composer config platform.php 8.3
composer require --dev authlab/fluent-tester
# Optionally revert later:
# composer config --unset platform.php
```

Option B — one-off install ignoring platform

```
composer require --dev authlab/fluent-tester --ignore-platform-req=php
```

Option C — developer-only composer file (kept out of VCS)

```
{
  "config": { "platform": { "php": "8.3" } }
}
```

Install using:

```
COMPOSER=composer.local.json composer require --dev authlab/fluent-tester
```

Be sure to git-ignore `composer.local.json`.

Note: Regardless of composer configuration, the runtime PHP used to execute the test suite must be PHP 8.1+.

Quick Start
-----------

[](#quick-start)

1. **Configure Environment**

    Copy the environment template and configure for your setup:

    ```
    cp .env.testing .env
    # Edit .env with your WordPress and database settings
    ```
2. **Initialize Test Environment**

    ```
    ./vendor/bin/fluent-tester init
    # or
    composer init
    ```
3. **Run Tests**

    ```
    # Run all tests with Pest
    composer test

    # Run specific test suites
    composer test-unit          # Unit tests (fast)
    composer test-integration   # Integration tests with WordPress
    composer test-functional    # Functional tests with browser
    ```

    #### Versions and Stability

    [](#versions-and-stability)

    If you see "Could not find a version of package authlab/fluent-tester matching your minimum-stability (stable)":

    - Preferred (after a release tag is published): ```
        composer require --dev authlab/fluent-tester:^2.0
        ```
    - Until a tag exists (use dev stability explicitly): ```
        # Option 1: require dev branch with alias
        composer require --dev "authlab/fluent-tester:dev-master as 2.0.x-dev"
        # Option 2: use stability flag
        composer require --dev authlab/fluent-tester:^2.0@dev
        # Or explicitly require the branch
        composer require --dev authlab/fluent-tester:dev-master
        ```

    Branch naming note:

    - If the repository default branch is "master", use `dev-master`
    - If the repository default branch is "main", use `dev-main`

    Composer allow-plugins (non-interactive):

    - Composer may prompt to allow `pestphp/pest-plugin`. To avoid prompts (e.g., CI), configure in your project: ```
        composer config allow-plugins.pestphp/pest-plugin true
        composer config allow-plugins.codeception/c3 true
        ```

        Or add to your root composer.json: ```
        {
          "config": {
            "allow-plugins": {
              "pestphp/pest-plugin": true,
              "codeception/c3": true
            }
          }
        }
        ```

    Testing Architecture
    --------------------

    [](#testing-architecture)

### Test Types

[](#test-types)

- **Unit Tests** (`tests/Unit/`) - Pure PHP logic testing with WPLoader
- **Integration Tests** (`tests/Integration/`) - WordPress integration with database
- **Functional Tests** (`tests/Functional/`) - Browser-based WordPress testing
- **Acceptance Tests** (`tests/Acceptance/`) - Full end-to-end user scenarios

### Test Syntax

[](#test-syntax)

Write expressive tests using Pest PHP syntax:

```
