Download the PHP package codeception/domain-assert without Composer

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

Domain Assertions

Assertion library for PHPUnit or Codeception powered by Symfony Expression Language.

Pitch

This tiny library helps you to create domain-specific assertions in tests:

Instead of:

use

Why?

See how test fails in first example:

And how test fails in second example:

What makes more sense to you? In second example you get the business logic behind the assertion as well as values passed into it. That's why if you have business logic in your project domain-assert is your choice.

How To Use It

Install this package:

Create a trait with a custom assertion. We recommend using traits as you can reuse them accross different test cases.

In this example we check that $user exists and $user->isValid() return true;

That's all! Now inject this trait to TestCases and use it.

Defining Business Rules

This library uses Expression Language to define domain rules for assertions.

Let's define a rule to check if we have enough products in the stock:

We have 3 items here: product, stock, and amount which is a number of items we need. Let's create assertion according to this rule:

Now it can be used inside your tests:

Advanced Concepts

License

Open-source software licensed under the MIT License. © Codeception PHP Testing Framework


All versions of domain-assert with dependencies

PHP Build Version
Package Version
Requires phpunit/phpunit Version ^7.0|^8.0|^9.0
symfony/expression-language Version ^3.3|^4.0|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 codeception/domain-assert contains the following files

Loading the files please wait ....