Download the PHP package hershel-theodore-layton/test-chain without Composer

On this page you can find all versions of the php package hershel-theodore-layton/test-chain. 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 test-chain

Test Chain

Inferred types for your tests, just append.

This package was written to replace HackTest.

This package is enjoyed best with an assertion library, such as expect.

Usage

Create a tests/ directory at the root of your project (next to vendor/). This package ships with a bin/test-chain script. Do not pass any command line arguments to this script.

This script will create a JSON file at tests/test-chain/config.json. The defaults will likely suffice, but you can change the configuration to your liking. The tests/run.hack file template is meant for you to customize, and allows you to do setup work before running the tests.

Let's add your first test. Create tests/math_test.hack with this content.

You can discover your tests using vendor/bin/test-chain. You can runs your tests with vendor/bin/test-chain --run. You should see this output.

It is common to want to execute the same test with multiple values. This is called a data-provider test. Here is an example of such a test:

Running in CI

When running in CI, you don't want to suddenly discover new tests. If that were allowed, the tests you see in git and what runs in CI wouldn't be the same. By passing --ci to vendor/bin/test-chain, you assert the chain.hack file was correct and invoke the tests in the same way as with --run.

Performance on small test suites

By default, HHVM will try to JIT your tests as you run them, unless overridden in your global HHVM configuration. This is not helpful on most small test suites. vendor/bin/test-chain-no-jit behaves exactly like vendor/bin/test-chain, but invokes hhvm without the JIT. This can shave off a second of your test execution time. It will run a test suite with a handful of fast tests in 0.5 seconds instead of 1.5 seconds.

If you want to run your tests in 0.05 seconds, you can host your tests as a web server. hhvm -m server -p <%port%> and curl http://localhost:<%port%>/tests/test-chain/run.hack. This will not crawl your tests directory for new test functions. Chained tests on existing functions will be found and run, but new <<TestChain\Discover>> functions must be explicitly crawled for with the CLI script.

Upgrades and compatibility

When the codegen for chain.hack changes, all invocations with --ci will fail. Running without --ci will regenerate this file and further invocations of --ci will not fail. If a change to chain.hack breaks the call in run.hack, you can regenerate it with --update. Your custom change will have to be reapplied. If none of that works, --reset will treat your project as a brand-new project, keeping the license comment and the namespace the same for convenience.

These breakages in codegen will not require a major version bump.


All versions of test-chain with dependencies

PHP Build Version
Package Version
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 hershel-theodore-layton/test-chain contains the following files

Loading the files please wait ...