Download the PHP package litvinab/rest-api-test without Composer

On this page you can find all versions of the php package litvinab/rest-api-test. 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 rest-api-test

RestAPITest

This symfony bundle is made to simplify testing of your rest API.

It can be useful for functional tests based on data fixtures and for acceptance tests.

Also current bundle provides some aliases of doctrine commands. It was made to prevent copy-paste of the same commands in your CI (for example, in Makefile, in setup of your tests, etc.)

Contents

Installation

Install via Composer:

Enable Bundle

In your app/AppKernel.php file, add the following to your list of dev bundles:

Commands

Functional Data Fixtures Based Tests

Configuration

1. Setup parameters_test.yml with test database name and connection details;

2. Create data fixtures and configure them right;

How To Use

Extend test cases mentioned below and call method to reload test data fixtures before each test or before specified test.

Call db:create, db:create-schema before using to create test database and create database schema;

FixturesWebTestCase

It can be useful in repositories tests to have the same database state at the beggining of each test.

Methods:

RestFixturesWebTestCase

Methods:

Asserts:

Examples

FixturesWebTestCase

RestFixturesWebTestCase

Acceptance (Behat) Tests

Configuration

1. Add route to routing.yml:

2. Add parameters to parameters.yml (rest_api_test.access_token value should be secured enough):

rest_api_test.controller_on (false by default) - parameter to turn ON/OFF endpoint to reload database in symfony prod environment.

Be careful! It should be turned ON for acceptance tests (external tests of rest API) only.
Do not turn ON it at production server! It would be good to setup additional security rules for this endpoint, for example, white list of IPs.

rest_api_test.access_token (empty string by default) - random strong password, for example, 5j%]4fX.)z[HTR{M; This token required to access to reload db endpoint; It will be applied only ifrest_api_test.controller_on is set to true;

How To Use

Your application side:

1. Setup data fixtures if they weren't setup yet;

2. Setup separated application instance with not production database;

Bundle provides possibility to reload data fixtures in prod symfony environment to make possible an end-user testing;

3. check configuration setup in parameters.yml;

Behat tests runner side:

Make GET request to reload database state of your application. It should be made before each acceptance test.

Endpoint: http://YOUR_DOMAIN/api/test/db/reload

Custom header: Rest-API-Test-Access-Token: 5j%]4fX.)z[HTR{M (value is value of rest_api_test.access_token parameter);

As result database mentioned in parameters.yml should be reloaded with your test data fixtures;


All versions of rest-api-test with dependencies

PHP Build Version
Package Version
Requires symfony/symfony Version ^2.7|^3.0
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 litvinab/rest-api-test contains the following files

Loading the files please wait ....