Download the PHP package tiny/symfony-testing without Composer

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

tiny/symfony-testing

Assistive package for doing functional testing on web applications built with Symfony framework.

Contains two major components:

Currently only Symfony 3.4 is supported.

TinyTestingBundle

Bundle enables displaying actual exceptions thrown when running functional tests on Symfony application. It allows all Symfony\Component\HttpKernel\Exception\HttpException-s to be processed in a normal way (e.g. for twig can render a 404 page), and will rethrow any other exception so it can be caught by PHPUnit and reported.

If you make html web app, then while browsing it in dev mode and when something bad happens, you see a nice page with all the information about the exception (its class, code, message, stack trace, etc.). When runnning tests it is more valueable to have this exception actually thrown, so it can be reported to the console (or whatever output you or your IDE use).

Of course, there is an option to do

in the test case. This will force HttpKernel throw exception instead of dispatching kernel.exception event.

The problem is that using this option requires some manual work (not much but on a regular basis). We have to either turn catching off each time we want to see an exception (and rerun the tests) or take care of creating (or configuring) different clients to support both cases.

Most likely, bundle should be registered only for test environment:

WebTestCase

Provides some assistive interface for functional testing. Extends Symfony's native Symfony\Bundle\FrameworkBundle\Test\WebTestCase.

Its setUp() creates instance of a client (can be access directly via $this->client, it is a protected). So if you have your own setUp() make sure to call parent::setUp().

Some configurative (i.e. to be used before request) methods, they have impact on all subsequent requests.

protected function setHost($host)

sets the host, useful when request routing involves host requirements (like api.example.com/users)

protected function setHeader($name, $value)

so stuff like $this->setHeader('Authoriation', 'Bearer wh.at.ever'); can be done

protected function setCookie($name, $value, $expires = null, $path = null, $domain = '', $secure = false, $httponly = false)

Provided request methods:

protected request($uri, $method = 'GET', $parameters = [], $files = [], $server = [], $content = '', $changeHistory = true)

pretty much the same as in Symfony\Bundle\FrameworkBundle\Client::request except for $method and $uri parameters are swapped.

Some shortcut request methods:

protected function get($uri, $parameters = [])

protected function post($uri, $content = '', $parameters = [])

protected function put($uri, $content = '')

protected function patch($uri, $content = '')

protected function delete($uri, $content = '')

Before request it's possible to set some parameters using

protected function setParameters(array $parameters)

Request parameters set with this method are sent only with next single subsequent request.

Response and assertions

After request is made, it's possible to reach the response via $this->response (instance of Symfony\Component\HttpFoundation\Response).

Currently only single assertion implemented for response status code, accessible as $this->assertStatusCode($expectedCode).


All versions of symfony-testing with dependencies

PHP Build Version
Package Version
Requires php Version >=5.6
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 tiny/symfony-testing contains the following files

Loading the files please wait ....