Download the PHP package lapistano/wsunit without Composer

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

===============================================================================

!! DISCONTINUED !!

» Please use the successing project PHP-VCR «

================================================================================

PHPUnit WebServices Extension

The possibility to register test listeners to PHPUnit makes it extremly easy to execute actions on a certain state of the test runner (e.g. when the test is started). WSUnit make highly use of this possibility and listens to some of the emmited signals.

Current travis status: Build Status

Purpose

WSUnit lifts unit tests to functional tests by configuration. Once configured the test listener sends a request to a specified location, records the respond body & header, and persists it onto the filesystem. The test itself then e.g. verifies the correctness of the response. The Idea behind this was not to be forced to write API test more than once and to increase the reuse of already written verifications.

Installation

There is not much to install but to download the sources, configure the test listener in the phpunit.xml.dist, and create the configuration file to tell the listener which test shall call which url ot fetch the response. If you are using composer you simply have to define the dependency to WSUnit in your configuration and set up WSUnit accourding to the following description.

Composer

This composer configuration will checkout the sources tagged as the 2nd release. In case your want the 'cutting eadge' version replace '2.*' by 'dev-master'. But be alarmed that this might be broken sometimes.

NOTE: In case you do not know what this means the composer project website is a good place to start.

Github

Thus I recommend the composer way to make proxy-object a dependency to your project. The sources are also available via github. Just clone it as you might be familiar with.

Configuation

The configuration has two parts. One is the registration of the actual test listener to PHPUnit, the 2nd is the definition of which test (identified by it's name) shall be request the response of which location.

PHPUnit

For the PHPUnit configuration please visit http://www.phpunit.de/manual/current/en/appendixes.configuration.html and read the 'Test Listener' section or copy the example to your configuration and simply adapt the location of your configuration file.

Arguments

(object) Extensions_Webservice_Listener_Factory Factory class providing objects mandatory for the operation of the listener.

(object) Extensions_Webservice_Listener_Loader_Configuration Object to load the configuration file.

(array) Contains the names of classes to be registered to the factory and the location of the location definition file.

Test listener configuration

Beside making PHPUnit aware of the test listener and to actually make each test aware of the loaction the response shall be fetched from, a 2nd configuration file is needed. The following example show such a configuration.

NOTE: The name and the location of the configuration file is set in the element[key='configuration'] element of the test listener registration in PHPUnit.

WARNING: Beware that if you decide to use namespaces they also have to be used in the phpunit configuration file to identify the used classes. In case you did something wrong here PHPUnit will just ignore your listener without any warning or error being thrown. Don't ask me why I know this. This behavior is fixed in PHPUnit 3.7.

Available tags

Dependencies

Optional

To be done

As far as ws unit has come by now, unfortunately it is far from being complete. The following list shall give you an idea about what to be expected next:

If you have other usecases, ideas and/or demands feel free to fork and contribute. You are more than welcome ;)


All versions of wsunit with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.6
lapistano/proxy-object Version 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 lapistano/wsunit contains the following files

Loading the files please wait ....