Download the PHP package sebastianknott/test-utils without Composer

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

test-utils

Some classes i like to use for testing purposes

System Under Test (SUT) Factory

I don't like to do tedious work, so I created a factory that creates the System Under Test (SUT) for me. The factory creates a new instance of the SUT and mocks its constructor dependencies as good as it can.

It returns a Bundle object that contains the SUT and the mocks.

Type of Mocks

It supports two types of mocking libraries (Mockery, Phake) and can be configured to use one of them by passing the respective MockTypeEnum to BundleFactory::build.

Prebuild Parameters

If the SUT has dependencies that are not mockable, you can pass them as a prebuild parameter to the factory. The prebuild parameter is an associative array where the key is the name of the parameter in the suts constructor and the value is the instance.

TestToolsCase

I found myself writing the same boilerplate code over and over again. So I condensed it into a base class that I can extend from.

It does the following:

So instead of writing this:

I write that:


All versions of test-utils with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
phake/phake Version ^v4.5
mockery/mockery Version ^1.6
phpunit/phpunit Version ^9.5|^10.0|^11.1.3
hamcrest/hamcrest-php Version ^2.0
sebastianknott/hamcrest-object-accessor Version ^2.0
fakerphp/faker Version ^v1.23.1
infection/infection Version >0.28.0
phpspec/prophecy Version ^v1.19
brianium/paratest Version ^v7.4
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 sebastianknott/test-utils contains the following files

Loading the files please wait ....