yireo / magento2-live-test-runner

yireo/magento2-live-test-runner

N/A

magento2-module Compatibility: 2.4.7-2.4.8 Code Quality: Fail Tests: Pass Security: Pass OSL-3.0

Yireo Live Test Runner for Magento 2

Magento version
PHP version
License
Latest Version

This module allows you to run PHPUnit-based live tests in Magento 2. Normally, PHPUnit-based code focuses on creating unit tests, integration tests, functional tests and other. But what if you simply want to debug an issue in a copy of a production site? Not a controlled clean environment, but the real deal. To guarantee that certain functionality remains, testing makes sense here as well. Hence the dubbed live tests.

A live test is nothing more than a PHPUnit test, but including the Magento application (including database, caching and other) as a bootstrap. With this, you can fetch products from the database and guarantee that their

Installation

Install this module as a development dependency, so that it (and PHPUnit) does not end up in production deployments:

composer require --dev yireo/magento2-live-test-runner

Usage

Create your own tests within a folder Test/Live (or something else). Next, run the following command, pointing towards your testing folder:

bin/magento yireo_livetest:run app/code/Foo/Bar/Test/Live

Done.

The testing folder needs to be located within the Magento root folder.

Production mode

Live tests run with full access to the Magento application and its database, so they are able to modify or delete real data. Therefore, the command refuses to run when Magento is in production mode. If you are sure what you are doing (for instance, on a copy of a production site), add the --force flag:

bin/magento yireo_livetest:run app/code/Foo/Bar/Test/Live --force

Tests could be extending upon the parent classes \Yireo\LiveTestRunner\TestCase\CatalogTestCase and
\Yireo\LiveTestRunner\TestCase\GenericTestCase, but only if you want to: You can make any assertions
using any library out there. This module simply makes sure the Magento bootstrap of your actual dev
environment is run.

Current status

Static Tests
Unit Tests
Integration Tests
Playwright
DI Compilation

Changelog

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog,
and this project adheres to Semantic Versioning.

[Unreleased]

[0.0.4] - 25 November 2026

Added

  • Option --force to explicitly allow running live tests in production mode
  • README with installation, usage and production-mode notes

Changed

  • Requires PHP 8.2 to 8.5 (PHP 8.1 support dropped, PHP 8.5 support added)
  • Replace wildcard dependency on magento/framework with ^103.0

Fixed

  • Live tests could be run accidentally in production mode; the command now refuses unless --force is given
  • Test folder is now restricted to the Magento root, resolved to an absolute path and escaped in console output
  • Require PHPUnit versions patched for CVE-2026-24765 (^9.6.34 || ^10.5.63)
  • Command did not work with PHPUnit 10 and did not return an exit code
  • Deprecation of implicit trim characters under PHP 8.6
  • Missing dependencies on Magento_Catalog and symfony/console
Versions
Version Stability QA Status Compatibility Released
0.0.4 stable Fail Magento 2.4.7-2.4.8 Details 2026-11-25 16:59:29
0.0.3 stable Fail Not yet tested Details 2021-05-14 14:35:57
0.0.2 stable Not tested Not yet tested Details 2021-05-14 06:46:36
0.0.1 stable Not tested Not yet tested Details 2021-05-14 06:39:50

Requires 5

Package Constraint
magento/framework ^103.0
magento/module-catalog ^104.0
php >=8.2 <8.6
phpunit/phpunit ^9.6.34 || ^10.5.63
symfony/console ^5.0 | ^6.0 | ^7.0

Requires-dev 1

Package Constraint
yireo/magento2-integration-test-helper ~0.0

Compatibility

Each Magento release line is installed on its supported PHP versions, then the module is built (DI compilation + static-content deploy) and its unit and integration suites are run. The matrix shows the lines and PHP versions the module is confirmed to install and run on. Code-quality results further down (phpstan, phpcs, …) are reported separately and never affect compatibility.

Compatibility matrix (Magento × PHP)
Magento PHP 8.2 PHP 8.3 PHP 8.4 PHP 8.5
2.4.7 Pass Pass
2.4.8 Pass Pass
2.4.9 not tested not tested

Code Quality

Advisory checks against the module's source. Static analysis runs once across the whole module; PHPStan re-runs per Magento + PHP version because resolvable symbols differ between releases. These NEVER affect the Compatibility badge. A phpcs finding can't make a module incompatible.

Static analysis

Coding standards (phpcs), mess detection (phpmd), copy-pasted code (cpd), PHP cross-version compatibility, composer.json validity. Each runs once for the whole module.

Static analysis results
Tool Status Findings Summary
PHPCS Warning 4 4 warnings (ruleset: Magento2)
PHPMD Warning 3 3 rule violations (MissingImport:2, EmptyCatchBlock:1)
Cpd Pass 0
Composer validate Info 1 valid; 1 advisory note (composer validate --strict)

PHPStan

Type-checks the module's PHP against a real Magento install at the configured gate level. Re-runs per Magento and PHP version because resolvable symbols differ between releases.

PHPStan results by Magento and PHP version
Magento PHP 8.2 PHP 8.3 PHP 8.4 PHP 8.5
2.4.7 Error Error
2.4.8 Pass Pass
2.4.9 5 5

Tests

Unit and integration suites, run for each applicable Magento and PHP version. A test failure speaks to the module's behaviour, not its compatibility with a Magento line, so it is reported here separately and never reddens the compatibility matrix.

Unit tests

Unit tests results by Magento and PHP version
Magento PHP 8.2 PHP 8.3 PHP 8.4 PHP 8.5
2.4.7 N/A N/A
2.4.8 N/A N/A
2.4.9 N/A N/A

Integration tests

Integration tests results by Magento and PHP version
Magento PHP 8.2 PHP 8.3 PHP 8.4 PHP 8.5
2.4.7 Pass Pass
2.4.8 Pass Pass
2.4.9 N/A N/A

Security

Security checks run directly against the module: an audit of its declared dependencies for known vulnerabilities (composer audit) and a scan of its source for malware and web-shell signatures. Each runs once. A malware detection fails the version outright.

Security results
Tool Status Findings Summary
Composer audit Pass 0
Malware scan Pass 0
License
OSL-3.0

More from yireo

View vendor
Make it pay

Turn an existing module into recurring revenue.

If you already maintain a Magento 2 module on GitHub or GitLab, listing it on Packagento takes about five minutes. We mirror your tags, handle distribution signing, and route paid licenses through Stripe Connect, so you can keep shipping the way you already do.