Download the PHP package solido/test-utils without Composer

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

This package contains some testing utilities common to various solido suite packages.

Functional tests

JsonResponseTrait

Provides assertions to check content and deep properties of a returned json response. The response has to be provided by a static getResponse method and must be an instance of Symfony\Component\HttpFoundation\Response.

Property paths

The assertions in this trait allow checking deep properties into the returned JSON passing a property path to the assertion method.

Dots (.) are used to access object properties, while brackets ([]) are used to access array indexes.

Example: user.emails[1] should return the second element of the emails property of the user object.

A special property path . can be used to indicate the entire json object or array contained in the response.

Assertions

assertJsonResponse(string $message = '')

Asserts that the response contains a JSON and has a Content-Type header containing application/json. If the response content cannot be decoded, the assertion will fail.

assertJsonResponsePropertiesExist(array $expected, string $message = '')

Asserts that the JSON response contains all the properties in the $expected array. The properties are specified as property paths.

assertJsonResponsePropertyExists(string $propertyPath, string $message = '')

Asserts that one property path exists in the response object.

assertJsonResponsePropertyDoesNotExist(string $propertyPath, string $message = '')

Asserts that one property path does not exist in the response object.

assertJsonResponsePropertyEquals($expected, string $propertyPath, string $message = '')

Asserts that the value in property path equals the $expected value. PHPUnit IsEqual constraint is used to check the values equality.

assertJsonResponsePropertyNotEquals($expected, string $propertyPath, string $message = '')

Asserts that the value in property path does not equal the $expected value.

assertJsonResponsePropertyIsType(string $expected, string $propertyPath, string $message = '')

Asserts that the value in property path is of the specified type. Type can be a FQCN or builtin type (array, bool, float, int, null, object, resource, string, scalar, callable). PHPUnit IsType constraint is used to check the property type.

assertJsonResponsePropertyIsArray(string $propertyPath, string $message = '')

Short-hand method for assertJsonResponsePropertyIsType('array', $propertyPath, $message)

assertJsonResponsePropertyCount(int $expected, string $propertyPath, string $message = '')

Asserts that the value in property path is countable and its count is equal to $expected.

assertJsonResponsePropertyContains($expected, string $propertyPath, string $message = '')

Asserts the specific response property contains the expected value.

Examples:

assertJsonResponsePropertyNotContains($unexpected, string $propertyPath, string $message = '')

Asserts the specific response property does not contain the expected value.

assertJsonResponsePropertyContainsString(string $expected, string $propertyPath, string $message = '')

Asserts that the property is a string and contains the given value.

ResponseStatusTrait

Provides assertions to check the status code of a Response object retrieved by a static getResponse method.

assertResponseIs(int $expectedCode, string $message = '')

Asserts that the response code is exactly the one passed in $expectedCode.

Short-hand assertions:

Assertions that checks multiple status codes:

FunctionalTestTrait

Provides convenient methods to perform a request on a Symfony WebTestCase. Includes ResponseStatusTrait and JsonResponseTrait.

Doctrine ORM

EntityManagerTrait

Provides an instance of EntityManager upon a mocked DBAL connection.
Useful to test a raw SQL composition and result hydration.

onEntityManagerCreated method can be used to customize the entity manager instance (or load/inject metadata) just after entity manager creation.

MockPlatform

Dummy DBAL platform for EntityManagerTrait.

Doctrine Mongo ODM

DocumentManagerTrait

Provides an instance of DocumentManager for mongo upon a mocked mongo Client.

Elastica ODM

DocumentManagerTrait

Provides an instance of DocumentManager for elastica upon a mocked elastica Client.


All versions of test-utils with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
cache/array-adapter Version ^1.0
phpspec/prophecy-phpunit Version ^2.0
solido/common Version ^0.3 || ^0.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 solido/test-utils contains the following files

Loading the files please wait ....