Download the PHP package tomasvotruba/fast-unit without Composer

On this page you can find all versions of the php package tomasvotruba/fast-unit. 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 fast-unit

fast-unit

Run a PHPUnit suite ~4x faster by splitting test classes across parallel workers that each boot PHP once and run many classes in a single process.

Ships prebuilt Go binaries committed under bin/dist/ — no download, no Go toolchain needed. Runs on PHP 7.2+ (only the tiny shim is PHP; the runner is a version-agnostic native binary), so it accelerates legacy suites too.

While it runs it prints a live weight-based progress line:

Progress ticks per finished chunk (chunk weight approximates runtime). It cannot go finer, because each worker runs its whole chunk in one warm PHP process -- that single boot is the speedup.

Install

Usage

The shim picks the matching binary for your OS/arch from bin/dist/ and execs it directly. To rebuild the binaries after a change, run ./build.sh (needs a Go toolchain) and commit the refreshed bin/dist/.

Flags

Flag Default Meaning
-p CPU count parallel workers
-bin vendor/phpunit/phpunit/phpunit phpunit entry script
-weight fixtures class weighting: fixtures | methods | size
-tmp-isolate true give each worker its own TMPDIR
-php php php interpreter

Positional args are the directories to scan (default rules-tests tests).

Environment overrides

Var Effect
FASTUNIT_BINARY=/path use this binary, skip the bundled one (custom build / airgap)

Why it is faster

Bootstrap dominates a class's run, not the assertions. A tool that spawns a fresh process per class pays the container-build cost once per class. fast-unit splits classes into N chunks balanced by weight, and each worker runs its whole chunk in one warm process — so the container is built N times, not once per class.

Weighting modes

Test impact analysis (-tia)

Run only the tests whose code actually changed:

Static, no coverage driver needed -- works on any PHP 7.2+ (uses only the built-in tokenizer, not pcov/xdebug):

  1. A tokenizer-based scanner reads each .php file's declared and referenced class names and builds a file dependency graph.
  2. For each test class, it takes the transitive closure from every file in the test's directory -- so a rule wired only in config/configured_rule.php is included -- and re-runs the class only if a file in that closure, or a fixture in its directory, changed since the last run.
  3. Change detection is a sha256 snapshot cached under .fastunit-cache/. The graph is rebuilt every run (fast: whole-repo scan is ~1s), so new files are always accounted for -- no stale map.

Safe by construction: static analysis over-approximates (an imported but unused class still forms an edge), so TIA may run a few extra tests, but it never skips a real dependency. On the first run (empty cache), or any scan error, everything runs.

Flags: -src (comma-separated source dirs, default src,rules), -tia-cache (cache dir, default .fastunit-cache).

Add .fastunit-cache/ to your .gitignore -- it is a local, machine-specific cache.

Isolation

With -tmp-isolate (default on), each worker gets its own TMPDIR so tools that cache under sys_get_temp_dir() (e.g. Rector's rector_cached_files) do not race across parallel processes. Turn it off for suites that do not need it.

Note: sharing one PHP process across classes can surface latent global-state leaks between test classes (static parameter providers, etc.). Reset such state in tearDownAfterClass().

License

MIT


All versions of fast-unit with dependencies

PHP Build Version
Package Version
Requires php Version >=7.2
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 tomasvotruba/fast-unit contains the following files

Loading the files please wait ...