Download the PHP package jameshalsall/phpspec-array-contains-matchers without Composer

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

PHPSpec Array Contains Matchers

Build Status

Provides additional contains matchers for arrays in PHPSpec

Requirements

The extensions has been built for PHPSpec 3.x and PHP 5.6 or later.

Installation

Install the extension via composer:

You can then add the extension to your phpspec.yml as follows:

Usage

The extension currently supports the following matchers:

containOnly matcher

The containOnly matcher is used when you want to ensure that an array value contains only the specified arguments. It was implemented to save you writing multiple calls to shouldContain().

Consider that ->getArray() returns [1, 2, 3], the following code in your spec would pass:

If any anything else was in the array would it would cause the spec to fail.

Similarly this can be negated with shouldNotContainOnly. Staying with the same example above, the following code would fail because there aren't any additional values in the array:

However if ->getArray() was to return [1, 2, 3, 4] then the above spec would pass.

containAnyOf matcher

The containAnyOf matcher is used when you want to ensure that an array contains at least one of the specified arguments.

Consider that ->getArray() returns [1, 2, 3] as above, the following assertion would hold true:

However the following example would not:

Similarly this can be negated with shouldNotContainAnyOf. Staying with the sample example, the following code would fail:

This is because it contains the value 3, which is one of the values we have said it should not contain.

containAllOf matcher

The containAllOf matcher will evaluate to true when the array contains all of the elements passed to the matcher.

If ->getArray() returns [1, 2, 3] then the following assertion would hold true:

However the following example would not:

Similarly this can be negated with shouldNotContainAnyOf. Staying with the same example, the following code would fail:


All versions of phpspec-array-contains-matchers with dependencies

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

Loading the files please wait ....