Download the PHP package geckoboom/whirlwind-application-testing without Composer

On this page you can find all versions of the php package geckoboom/whirlwind-application-testing. 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 whirlwind-application-testing

Whirlwind Application Tests

Application tests check the integration of all layers of the application (from routing to the responses). They are based on PHPUnit framework and have a special workflow:

  1. Make a request
  2. Test the response

Requirements

Installation

The preferred way to install this extension is through composer.

Either run

or add

to the require-dev section of your composer.json file.

Defining a TestCase

To define your REST tests infrastructure you have to create a TestCase class that extends RestTestCase and implement realization for createApplication() method.

The following code defines a whirlwind application TestCase

In the above example, we have minimum configuration for making application tests

Now you can make REST tests. Just create new test and extend created earlier TestCase

In the above example, the test add Bearer authorization token and validates if HTTP request was successful, have 200 status code and contains appropriate header and body fragment in response.

Making Requests

The TestCase simulates an HTTP client like a browser and makes requests into your Whirlwind application. By default you can access to the next HTTP methods:

If required HTTP method absent in the list above you can make HTTP request via call() or json() method.

The full signature of the call() and json() methods

Available Response Assertions

Fixtures

Fixtures are used to load "fake" set of data into a database for testing purpose. Fixture can depend on other fixtures (WhirlwindApplicationTesting\Fixture\Fixture::$depends property).

Defining a Fixture

To define a fixture, just create a new class that implements WhirlwindApplicationTesting\Fixture\FixtureInterface.

Tip: Each EntityFixture is about preparing a DB table for testing purpose. You may specify appropriate realization of TableGatewayInterface in constructor as well as a Hydrator realization property. The table name encapsulates in table gateway, while hydrator uses for mapping raw results in WhirlwindApplicationTesting\Fixture\EntityFixture::$entityClass objects

The fixture data for an EntityFixture fixture is usually provided in a file located at data directory where fixture class is declared. The data file should return an array of data rows to be inserted into the table. For example:

Dependable fixture can be created by specifying WhirlwindApplicationTesting\Fixture\Fixture::$depends property, like the following

The dependency allows you to load and unload fixtures in well-defined order. In the above example UserFixture will always be loaded before UserProfileFixture.

Using Fixtures

If you are using fixtures in your test code, you need to add WhirlwindApplicationTesting\Traits\InteractWithFixtures trait and implement fixtures() method

The fixtures listed in the fixtures() method will be automatically loaded before a test is executed.


All versions of whirlwind-application-testing with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0.0
ext-json Version *
phpunit/phpunit Version ^9.0
mockery/mockery Version ^1.4
justinrainbow/json-schema Version ^5.2
ext-mbstring Version *
softcreatr/jsonpath Version ^0.8.2
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 geckoboom/whirlwind-application-testing contains the following files

Loading the files please wait ....