Download the PHP package bound1ess/essence without Composer

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

Essence 1.5.1 Build Status

Essence is a very flexible BDD style assertion framework for PHP that fits into existing PHPUnit projects nicely.

Installation

The Idea

In most PHP testing frameworks, you are tied to concrete matcher names (e.g., assertEqual, shouldHaveType). I don't like that. That's why I created Essence.

Usage

In order to run a matcher you need to specify it in the query string. So what is a query string? Have a look:

Yes, Essence is smart enough to handle all these cases just as you would expect it to do. So, how do you build a query string (or assertion)?

  1. Decide if you need to configure a matcher you plan to use. As for now there are two only matchers that can be used in configuration mode - ValuesMatcher and KeysMatcher.
  2. Determine what matcher you will need to use to get the job done. Is it ThrowMatcher, or, say, RespondMatcher?
  3. Add some links to make the assertion readable.
  4. Choose an appropriate entry point (expect, this, these etc).
  5. Pass a proper value and arguments.
  6. If you want to, add ->go() to immediately perform validation. I'll tell you more about that later.

Configuration

First of all, Essence leverages the singleton pattern to persist all its important data during the runtime. It means that this expression will always be equal to true:

You can configure Essence by using configure method:

Available configuration options:

Name Possible value
exception fully qualified class name (as a string)
implicit_validation a boolean value (true or false)
links an array (won't be merged automatically)
matchers an associative array name => aliases (won't be merged automatically)

Explicit and implicit, validateAll and PHPUnit extension

If you don't want to write ->validate() or ->go() every time, you can enable implicit validation:

It will validate the last (previous) assertion when you create a new one. Or, even better, just use the PHPUnit extension as shown below:

It'll do the job for you, no need to configure anything or call go/validate.

Verbose mode

This line of code will throw an Essence\Exceptions\AssertionException by default:

However, if you pass true to validate/go, Essence will dump all important data and just exit.

Cheatsheet

Entry points

Links

Matchers

Name Aliases
TypeMatcher an, a, type
ContainMatcher contain, include
PositiveMatcher ok, fine
TrueMatcher true
FalseMatcher false
NullMatcher null
EmptyMatcher empty
EqualMatcher equal
LikeMatcher like
AboveMatcher above
BelowMatcher below
LeastMatcher least
MostMatcher most
WithinMatcher within
LengthMatcher length
MatchMatcher match
KeysMatcher key, keys
ValuesMatcher value, values
ThrowMatcher throw, raise
RespondMatcher respond
CloseMatcher close

License

The MIT License (MIT).

Development

The Makefile contains all sorts of useful tasks.

Running tests

Creating code coverage report

Building documentation


All versions of essence with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4.0
php-packages/container Version ~1
php-packages/fluent Version ~1
php-packages/dumpy Version ~1
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 bound1ess/essence contains the following files

Loading the files please wait ....