Download the PHP package atoum/bdd-extension without Composer

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

atoum/bdd-extension Build Status

This extensions helps you to write your tests (specs) in a Behavior Driven development fashion.

Example

and the output will look like this :

Install it

Install extension using composer:

Enable the extension using atoum configuration file:

Use it

Your first spec

The extension requires you to place your specs in a specs namespace and make them extend atoum\spec. Let's write a spec for the jubianchi\example\formatter class:

Running your first spec

And run it again until you get green:

You can use the --loop flag to work incrementally: vendor/bin/atoum -d specs --loop

Reading the report

The spec report uses a set of icon to identify examples' statuses:

Spec syntax

Invoking methods

Invoking a method is the process of calling a method on a tested object in a way that will allow the tester to assert on method behavior:

This example will invoke the format method of the $formatter object with one argument, __FUNCTION__.

There are several way of invoking method, depending on which syntax you prefer:

Asserting on returned values

The spec extension provides some shortcut to assert on method return value.

As you can see, shouldReturn lets you assert on invoked method return value. Again, there are several way of doing the same:

Calling shouldReturn with a parameter will fallback on the atoum\asserters\variable::isEqual assertion which is the less strict one in atoum. You can of course use strict assertions to do some type checking:

Asserting on thrown exceptions

Asserting on exception is quite simple and similar to asserting on returned values:

As for shouldReturn, shouldThrow provides some alternative synatxes:

Calling shouldThrow this way will fallback on atoum\asserters\exception::isInstanceOf, if you don't want to check the exception type, you can simple omit the argument:

Of course, you can also check the exception message using regular assertions:

Links

Licence

bdd-extension is released under the BSD-3-Clause. See the bundled LICENSE file for detail.

atoum


All versions of bdd-extension with dependencies

PHP Build Version
Package Version
Requires php Version ^5.4.0 || ^7.0.0 || ^8.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 atoum/bdd-extension contains the following files

Loading the files please wait ....