Download the PHP package xp-framework/unittest without Composer

On this page you can find all versions of the php package xp-framework/unittest. 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 unittest

Unittests

Build status on GitHub XP Framework Module BSD Licence Requires PHP 7.0+ Supports PHP 8.0+ Latest Stable Version

Unittests for the XP Framework

Writing a test

Tests reside inside a class and are annotated with the @test attribute.

To run the test, use the test subcommand:

Assertion methods

The unittest package provides the following six assertion methods:

If you need more than that, you can use xp-forge/assert on top of this library.

Setup and teardown

In order to run a method before and after the tests are run, annotate methods with the @before and @after attributes:

Note: All test methods are run with the same instance of CalculatorTest!

Expected exceptions

The Expect attribute is a shorthand for catching exceptions and verifying their type manually.

Ignoring tests

The Ignore attribute can be used to ignore tests. This can be necessary as a temporary measure or when overriding a test base class and not wanting to run one of its methods.

Parameterization

The Values attribute can be used to run a test with a variety of values which are passed as parameters.

Actions

To execute code before and after tests, test actions can be used. The unittest library comes with the following built-in actions:

Multiple actions can be run around a test by passing an array to the @action attribute.

Further reading


All versions of unittest with dependencies

PHP Build Version
Package Version
Requires xp-framework/core Version ^11.0 | ^10.0 | ^9.0 | ^8.0 | ^7.0
php Version >=7.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 xp-framework/unittest contains the following files

Loading the files please wait ....