Download the PHP package hmaus/spas without Composer

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

Spas

That sounds like "spa", but plural.
It tests your API description against a given environment using real HTTP requests.

Minimum PHP Version Build Status Test Coverage Code Climate

Note

Spas is currently alpha, so its API is subject to change!

How It Works / Example

There is a running example in the example dir including a readme to follow along.

In order to use spas, you'll need:

Running spas looks like:

Installation

From Source

The recommended way to install spas & co is by using composer.

API Description Parser

In this example, we'll install drafter to work with API Blueprint.

Now configure the drafter installer accordingly. Make sure to actually install drafter, usually you'll add a script to call composer install-drafterduring the config, and check it using vendor/bin/drafter -v.

Request Parser

Please see a guide to create a request parser if your parser is not yet supported

This will get you \Hmaus\Spas\Parser\Apib\ApibParsedRequestsProvider to put into spas' request_provider option

Spas

Now we can install spas itself:

With a default composer config, spas should now be available as vendor/bin/spas.

Hooks

The hook system is what makes spas pretty flexible. It allows you to add bits and pieces of code to manipulate requests, assert outcomes and much more.

There are a few pre-built hooks for you to examine and try out.
Simply browse /src/Hook to see pre-built hooks; all the ones prefixed with Hello are examples to learn from.

Run Hook

Take your spas command add an option:

As you can see, the hooks are simply passed using their fully qulified class name. So as long as the classes sit inside thee autloader, you can use them right away.

To pass multiple hooks, simply repeat the --hook option for every one of them.

Pass Data to Hooks

Many of your hooks shall be flexible in what they can do, hence you want to configure them from the outside.
We suggest to use JSON format to pass data into a hook like so:

Note that you need to replace the backslashes with dashes for the --hook_data.
Let me know if you know how to make it work with the backslashes.

Write Your Own Hooks

Once you examine the existing hooks, you should already gathered all there is to know.
Create a new class that is ato-loadable, extend \Hmaus\Spas\Hook\Hook, implement the one abstract method and check Hook's API and the pre-built examples for best practices.


All versions of spas with dependencies

PHP Build Version
Package Version
Requires php Version >=7.0
guzzlehttp/guzzle Version ^6.2
hmaus/reynaldo Version ^0.1.2
hmaus/spas-parser Version ^1.2.0
jonnyw/php-phantomjs Version ^4.5
justinrainbow/json-schema Version ^2.0
sebastian/diff Version ^1.4
symfony/config Version ^3.1
symfony/console Version ^3.1
symfony/dependency-injection Version ^3.1
symfony/event-dispatcher Version ^3.1
symfony/filesystem Version ^3.1
symfony/http-foundation Version ^3.1
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 hmaus/spas contains the following files

Loading the files please wait ....