Download the PHP package we-bridge/functionnal-test-helpers without Composer

On this page you can find all versions of the php package we-bridge/functionnal-test-helpers. 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 functionnal-test-helpers

Symfony2 functionnal test helpers

This library offer you a set of Traits to ease the creation of functionnal tests for both REST api and normal HTML controllers of your symfony2 application. It also take care as much as possible to close the database connections after the tests are done (which by default phpunit seems not to do)

Installation

add in your composer.json :

Then the classes are accessible from the namespace WeBridge\TestHelpers

Documentation:

A more complete documentation is to come, waiting for that one can directly check the code, which has been made to be as clear as possible, if you got any specific question, you can open a ticket, we're quite fast to answer.

For ApiHelpersTrait

For the moment the Api go with the assumption that except for binary data (images etc.), you want to send and receive JSON encoded data

Perform requests

all these methods perform the request using $this->client and it's your responsability (for the moment) to create it to fit your needs

Once the Request is performed, the raw response is assigned in $this->response if the content is json, the decoded content will in $this->responseJson

Methods to play with data fixtures

Assert HTTP status code

`

Assert JSON returned

all these assets use the property $this->responseJson, which is populated by

Usage For REST Api

Example

Usage For normal Controllers

Note

The method getFirstElementByTestName('example') takes the first HTML tag with the attribute

data-for-test-name="example"

the goal being to put all identifier and selectors based on data-for-test-* attributes, the rationnal being that this way you can modify without fear your id and class or tag types without breaking your tests (and there's nothing more raging than to break tests because you refactorize the CSS)

License

MIT

Contributing

Contributions are warmly welcomed, be it

if you would like to contribute but have no clue on how to do it feel free to open an issue explaining what you want to do, and we will try to guide you step by step.


All versions of functionnal-test-helpers with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4.0
phpunit/phpunit Version ~4.4
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 we-bridge/functionnal-test-helpers contains the following files

Loading the files please wait ....