Download the PHP package ergebnis/phpunit-slow-test-detector without Composer

On this page you can find all versions of the php package ergebnis/phpunit-slow-test-detector. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package phpunit-slow-test-detector

phpunit-slow-test-detector

Integrate Merge Release Renew

Code Coverage Type Coverage

Latest Stable Version Total Downloads Monthly Downloads

This project provides a composer package and a Phar archive with an extension for detecting slow tests in phpunit/phpunit.

The extension is compatible with the following versions of phpunit/phpunit:

Installation

Installation with composer

Run

to install ergebnis/phpunit-slow-test-detector as a composer package.

Installation as Phar

Download phpunit-slow-test-detector.phar from the latest release.

Usage

Bootstrapping the extension

Before the extension can detect slow tests in phpunit/phpunit, you need to bootstrap it. The bootstrapping mechanism depends on the version of phpunit/phpunit you are using.

Bootstrapping the extension as a composer package

To bootstrap the extension as a composer package when using

adjust your phpunit.xml configuration file and configure the

To bootstrap the extension as a composer package when using

adjust your phpunit.xml configuration file and configure the

To bootstrap the extension as a composer package when using

adjust your phpunit.xml configuration file and configure the

Bootstrapping the extension as a PHAR

To bootstrap the extension as a PHAR when using

adjust your phpunit.xml configuration file and configure the

To bootstrap the extension as a PHAR when using

adjust your phpunit.xml configuration file and configure the

Configuring the extension

You can configure the extension with the following options in your phpunit.xml configuration file:

The configuration mechanism depends on the version of phpunit/phpunit you are using.

Configuring the extension

To configure the extension when using

adjust your phpunit.xml configuration file and configure the

The following example configures the maximum count of slow tests to three, and the maximum duration for all tests to 250 milliseconds:

To configure the extension when using

adjust your phpunit.xml configuration file and configure the

The following example configures the maximum count of slow tests to three, and the maximum duration for all tests to 250 milliseconds:

To configure the extension when using

adjust your phpunit.xml configuration file and configure one or more

The following example configures the maximum count of slow tests to three, and the maximum duration for all tests to 250 milliseconds:

Configuring the maximum duration per test case

You can configure the maximum duration for a single test case with

The following example configures the maximum durations for single test cases to 5.000 ms, 4.000 ms, and 3.000 ms:

[!NOTE]

Support for the @slowThreshold annotation exists only to help you move from johnkary/phpunit-speedtrap. It will be deprecated and removed in the near future.

Running tests

When you have bootstrapped the extension, you can run your tests as usually:

When the extension has detected slow tests, it will report them:

Understanding measured test durations

When using

The hooks event system supports eleven hook methods that phpunit/phpunit invokes during the execution of tests.

When the extension uses the hooks event system, it uses the PHPUnit\Runner\AfterTestHook, which receives the duration of invoking PHPUnit\Framework\TestCase::runBare() and more.

When phpunit/phpunit invokes PHPUnit\Framework\TestCase::runBare(), it will invoke the following methods before the first test method in the class:

When phpunit/phpunit invokes PHPUnit\Framework\TestCase::runBare(), it will invoke the following methods before every test method in the class:

When phpunit/phpunit invokes PHPUnit\Framework\TestCase::runBare(), it will invoke the following methods after every test method in the class:

When phpunit/phpunit invokes PHPUnit\Framework\TestCase::runBare(), it will invoke the following methods after the last test method in the class:

[!NOTE] Because of this behavior, the measured test durations can and will vary depending on the order in which phpunit/phpunit executes tests.

When using

the extension uses the new event system of phpunit/phpunit.

The new event system supports a wide range of events that phpunit/phpunit emits during the execution of tests.

When the extension uses the new event system, it uses and subscribes to the PHPUnit\Event\Test\PreparationStarted and PHPUnit\Event\Test\Finished events and measures the duration between the points in time when phpunit/phpunit emits the former and the latter.

When phpunit/phpunit invokes PHPUnit\Framework\TestCase::runBare(), it will invoke the following methods before the first test method in the class:

When phpunit/phpunit invokes PHPUnit\Framework\TestCase::runBare(), it will invoke the following methods before every test method in the class:

When phpunit/phpunit invokes PHPUnit\Framework\TestCase::runBare(), it will invoke the following methods after every test method in the class:

When phpunit/phpunit invokes PHPUnit\Framework\TestCase::runBare(), it will invoke the following methods after the last test method in the class:

[!NOTE] Because of this behavior, the measured test durations can and will vary depending on the order in which phpunit/phpunit executes tests.

Changelog

The maintainers of this project record notable changes to this project in a changelog.

Contributing

The maintainers of this project suggest following the contribution guide.

Code of Conduct

The maintainers of this project ask contributors to follow the code of conduct.

General Support Policy

The maintainers of this project provide limited support.

You can support the maintenance of this project by sponsoring @localheinz or requesting an invoice for services related to this project.

PHP Version Support Policy

This project supports PHP versions with active and security support.

The maintainers of this project add support for a PHP version following its initial release and drop support for a PHP version when it has reached the end of security support.

Security Policy

This project has a security policy.

License

This project uses the MIT license.

Credits

This package is inspired by johnkary/phpunit-speedtrap, originally licensed under MIT by John Kary.

Social

Follow @localheinz and @ergebnis on Twitter.


All versions of phpunit-slow-test-detector with dependencies

PHP Build Version
Package Version
Requires php Version ~7.0.0 || ~7.1.0 || ~7.2.0 || ~7.3.0 || ~7.4.0 || ~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0
phpunit/phpunit Version ^6.5.0 || ^7.5.0 || ^8.5.19 || ^9.0.0 || ^10.0.0 || ^11.0.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package ergebnis/phpunit-slow-test-detector contains the following files

Loading the files please wait ....