Download the PHP package deozza/philarmony-api-tester-bundle without Composer

On this page you can find all versions of the php package deozza/philarmony-api-tester-bundle. 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 philarmony-api-tester-bundle

PhilarmonyApiTester

[php]() [mysql]() [sqlite]() symfony Stable [License: MIT]()

Table of contents

About

PhilarmonyApiTester is a bundle made to test your API. It ensures the quality and the sturdiness of your application via unit and scenario testing.

Installation

You can install using composer, assuming it is already installed globally :

composer require deozza/philarmony-api-tester-bundle

Database preparation

You need to create a database specifically for your tests. To ensure the tests are executed with the same environment and database, this one will be reset at the end of each test.

We recommend the use of doctrine/doctrine-fxtures-bundle for the creation of a test database.

The database you use for the tests could be in MySQL or SQLITE3.

For performance reasons, we recommend using a SQLITE3 database for your tests.

How to use

Creating a ControllerTest

To tests a feature of your application, you need to create a folder in the test folder. Inside it, create a ControllerTest for each Controller related to that feature. The ControllerTest must match the following example:

Writing tests

The tests are written as an array following this structure:

They are written in the function addDataProvider.

Key Description Facultative
kind The kind of test you are executing No
test The content of the test No
test.method The method of the request you are sending No
test.url The route you are testing No
test.token The authorization token used for the test Yes
test.status The expected http status of the response No
test.in The payload sent with the request Yes
test.out The expected response from the request Tes

For now, only GET, POST, PUT, PATCH and DELETE methods are handled by PhilarmonyApiTester

Different kinds of tests

With PhilarmonyApiTester, you are able to test your application by sending requests one by one ("unit" testing) and by sending a group of request ("scenario").

In (payloads)

You are able to test your application by sending a specific payload with the in option and check how it reacts.

Out (expected responses)

You are able to check the response of the requests you have sent with the option out.

Testing with patterns

Sometimes, value sent by your app are hard to test because they are unpredictable. Testing with patterns will allow PhilarmonyApiTester to assert these values are in a specific scope and even manipulate them for future tests.

Folder structure

To test your application, you need to match the following folder structure:

.
├── tests                                   #   The basic Symfony test directory
│   ├── Foo                                 #   Feature you need to test
│   │   │── FooControllerTest.php           #   Controller of the feature you want to test
│   │   │                                       
│   │   ├── Payloads                            
│   │   │   └── ...                             #   File posted to your API
│   │   │   
│   │   └── Responses                           #   All the expected responses coming from the endpoints of your API when testing it
│   │       └── ...
│   └──
└──

Road map

Nothing is in the road map !


All versions of philarmony-api-tester-bundle with dependencies

PHP Build Version
Package Version
Requires php Version ^7.0
symfony/phpunit-bridge Version ^4.2.0 || ^4.3.0
symfony/browser-kit Version ^4.2.0 || ^4.3.0
symfony/dotenv Version ^4.2.0 || ^4.3.0
guzzlehttp/guzzle Version ^6.3
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 deozza/philarmony-api-tester-bundle contains the following files

Loading the files please wait ....