Download the PHP package live627/phpunit-garbage-collector without Composer

On this page you can find all versions of the php package live627/phpunit-garbage-collector. 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-garbage-collector

PHPUnit Garbage Collector

Tests Scrutinizer Code Quality Code Coverage

PHPUnit seems to waste a lot of memory because it instantiates a lot of objects before actually starting any test, meaning that the initial memory usage varies depending on the number of tests available.

Say, for example, that you have UserTest with 1k test methods. This will unfortunately result in 1k UserTest class instances before any of the tests are actually run. This is actually by design. In order to determine the number of tests, PHPUnit runs @dataProvider methods before actually running the tests (and the setUp method).

The problem comes once all of the tests in the test case have finished. Objects in memory are closer than they appear because they aren't dereferenced until after the entire test suite has finished. Fortunately, this is on the radar.

Inspired by Kris Wallsmith faster PHPUnit article. The claim that this test listener that speeds up PHPUnit tests about 20% by freeing memory is dubious and probably is outdated now that PHP 7 has rewritten zvals to be a bit more compact.

Installation

To install this library, run the command below and you will get the latest version

Usage

Just add to your phpunit.xml configuration

Ignoring Tests

Sometimes it is necessary to ignore specific tests, where freeing their properties is undesired. For this use case, you have the ability to extend the behaviour of the listener by implementing the IgnoreTestPolicy interface.

As an example, if we hypothetically wanted to ignore all tests which include "Legacy" in their test filename, we could create a custom ignore policy as follows

And pass it to the constructor of our test listener in phpunit.xml configuration


All versions of phpunit-garbage-collector with dependencies

PHP Build Version
Package Version
Requires php Version >=7.4
phpunit/phpunit Version >=8.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 live627/phpunit-garbage-collector contains the following files

Loading the files please wait ....