Download the PHP package karriere/phpspec-matchers without Composer

On this page you can find all versions of the php package karriere/phpspec-matchers. 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 phpspec-matchers

    Build Status codecov StyleCI

Collection of phpspec Matchers

This package contains a collection of additional phpspec matchers.

Installation

You can install the package via composer

To be able to use the matchers you need to add the following definition to your phpspec.yml

Matcher Usage

All custom matchers in this package implement the positive and the negative case. For example you can use:

and also

Matchers

General Matchers

Json Matchers

General Matchers

beAnyOf

This matcher allows to check the return value against a set of values. Assume you have some sort of random mechanism to get an integer between 2 and 4. The you can use the shouldBeAnyOf matcher:

beSomeOf

This matcher allows to check if the returned array values are contained in a set of values.

rangeBetween

This matcher allows to check if the given return value is inside a numeric range.

beEmpty

This matcher allows to check if the given return value is empty. The implementation uses the empty implementation.

beNull

This matcher allows to check if the given return value is null. The implementation uses the is_null implementation.

beLessThan

This matcher allows to check if the given return value is less than a specified value.

beGreaterThan

This matcher allows to check if the given return value is greater than a specified value.

Json Matchers

beJson

This matcher checks if the return value is a valid json string

haveJsonKey

This matcher checks if the returned json string contains a json key.

To match against subkey you can use the dot notation. For example let's assume the following json structure

The key for this check is 'key.subkey'

haveJsonKeyWithValue

This matcher checks if the returned json string contains the json key and the desired value. The dot syntax for subkeys can also be applied.

License

Apache License 2.0 Please see LICENSE for more information.


All versions of phpspec-matchers with dependencies

PHP Build Version
Package Version
Requires php Version >=7.1
phpspec/phpspec Version ^5.0 || ^6.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 karriere/phpspec-matchers contains the following files

Loading the files please wait ....