Download the PHP package raptor/test-utils without Composer

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

Raptor Test Utils

Build Status Code Coverage Codacy Badge Latest Stable Version License

(c) Mikhail Kamorin aka raptor_MVK

Overview

Package contains following components:

Installation

The suggested installation method is via composer:

Usage

Additional service methods

Add trait ExtraUtilsTrait to the class that contains tests or to the common base test class. After that the following static methods will be available:

Additional assertions

Add trait ExtraAssertionsTrait to the class that contains tests or to the common base test class. After that the following additional assertions will be available:

Virtual file system

Add trait WithVFSTrait to the class that contains tests or to the common base test class. Method setupVFS should be used in setUp method or in the test method just before using other methods of the trait. No tearDown actions is needed regarding virtual file system. After that the following additional methods will be available:

Test data loader

Data loader allows you to extract test data from data provider into separate JSON file. As a result of data loading a set of test cases is formed, where data for each test case is wrapped into container object. Values of specific fields from file are returned by getters. Such an approach allows you to solve the following tasks:

Requirements to JSON file:

Objects of first type are processed by following algorithm:

Intermediate result of data loader is an array of all objects of first type with values of service field _name as keys. Service field _name itself is excluded from the objects.

Then each array value is wrapped into TestDataContainer object. Values are retrieved from containers using getters. Name of getters follow standard agreements:

Generator of service file for IDE

Service file for IDE is used for auto-completion when using container objects. Generator is called by following command:

where path - path to directory with JSON files that contain test data. Directory is processed recursively. Requirements to JSON files:

As a result of the command execution, the _ide_test_containers.php file is generated in the project root. This file contains container class for each JSON file in the specified directory. Each container class is located in the root namespace and has the name obtained by converting the name of the JSON file to studly case and adding the suffix DataContainer. You can use auto-completion after adding a PHPDoc comment @var with appropriate class and variable.

Data loader usage example with trait WithDataLoaderTrait

Authors


All versions of test-utils with dependencies

PHP Build Version
Package Version
Requires php Version >=7.3.0
symfony/console Version ^3.0|^4.0
mikey179/vfsstream Version 1.6.*
nesbot/carbon Version ^2.19
ext-json Version *
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 raptor/test-utils contains the following files

Loading the files please wait ....