2017 © Pedro Peláez
 

library symfony-application-tests

Contains several generic test scenarios that can be applied to Symfony 2 applications.

image

webfactory/symfony-application-tests

Contains several generic test scenarios that can be applied to Symfony 2 applications.

  • Wednesday, March 22, 2017
  • by webfactory
  • Repository
  • 7 Watchers
  • 8 Stars
  • 5,047 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 1 Forks
  • 4 Open issues
  • 24 Versions
  • 3 % Grown

The README.md

Symfony Application Tests

Build Status, (*1)

Generic functional tests that can be applied to any Symfony application., (*2)

Applied Checks

The following checks are automatically applied as soon as the provided test cases are registered., (*3)

The checks are often simplistic, but they proofed to be helpful to find common configuration mistakes early., (*4)

Twig Templates

The tests ensure that the Twig templates are at least compilable and that all used functions are available., (*5)

Twig Extensions

Services that are registered as Twig extensions must at least implement the corresponding interface., (*6)

Event Subscribers

Registered event subscribers must implement the correct interfaces and all referenced listener methods must be callable., (*7)

Validators

Registered validators must implement the correct interface and in Symfony < 2.7, an alias must be provided in the configuration., (*8)

Form Types

Registered form types must implement the corresponding interface and aliases in configuration and implementation must match., (*9)

Role Annotations

It is ensured that only existing roles are referenced by @Secure annotations. The support for these annotations is provided by the SecurityExtraBundle, which does not belong to the Symfony core., (*10)

Example:, (*11)

/**
 * Check will fail if the role ROLE_ADMIN is not configured in the security.yml.
 *
 * @Secure(roles="ROLE_ADMIN")
 */
public function myAction()
{
    // [...]
}

Services

Each application service must be at least instantiable (abstract and synthetic services are excluded)., (*12)

Installation

Use the following command to install the package via Composer:, (*13)

composer require --dev webfactory/symfony-application-tests

Usage

Simply add the tests directory to your phpunit.xml:, (*14)

    <testsuites>
        <testsuite name="Application Test Suite">
            <directory>vendor/webfactory/symfony-application-tests/src/Webfactory/Tests/</directory>
        </testsuite>
    </testsuites>

The library uses the functional testing infrastructure from Symfony. Therefore, you might have to configure your kernel directory:, (*15)

    <php>
        <server name="KERNEL_DIR" value="/path/to/your/app/" />
    </php>

Details are available at http://symfony.com/doc/current/book/testing.html#your-first-functional-test., (*16)

Advanced Kernel Configuration

If the kernel directory configuration does not suit your needs, then you also have the opportunity to configure the class of the kernel:, (*17)

    <php>
        <server name="KERNEL_CLASS" value="My\TestKernel" />
    </php>

To make this work, the kernel must be loadable by the class loader., (*18)

Changelog

0.5.3 -> 0.6.0

Removed constraints on form type aliases, which are deprecated since Symfony 2.8., (*19)

This library was started at webfactory GmbH, Bonn., (*20)

Copyright 2014-2017 webfactory GmbH, Bonn. Code released under the MIT license., (*21)

The Versions

20/03 2017

dev-bugfix/do_not_load_class_files_when_determining_app_routes

dev-bugfix/do_not_load_class_files_when_determining_app_routes

Contains several generic test scenarios that can be applied to Symfony 2 applications.

  Sources   Download

MIT

The Requires

 

The Development Requires

testing symfony tests integration tests functional tests

20/02 2017

dev-feature/support_for_symfony_2.8_form_types

dev-feature/support_for_symfony_2.8_form_types

Contains several generic test scenarios that can be applied to Symfony 2 applications.

  Sources   Download

MIT

The Requires

 

The Development Requires

testing symfony tests integration tests functional tests

22/11 2016

dev-feature/increase_memory_limit_on_travis

dev-feature/increase_memory_limit_on_travis

Contains several generic test scenarios that can be applied to Symfony 2 applications.

  Sources   Download

MIT

The Requires

 

The Development Requires

testing symfony tests integration tests functional tests

23/05 2016

dev-bugfix/26_phpunit3_compatibility

dev-bugfix/26_phpunit3_compatibility

Contains several generic test scenarios that can be applied to Symfony 2 applications.

  Sources   Download

MIT

The Requires

 

The Development Requires

testing symfony tests integration tests functional tests

23/05 2016
18/05 2016
08/02 2016
19/12 2014
25/09 2014

0.0.1

0.0.1.0

Contains several generic test scenarios that can be applied to Symfony 2 applications.

  Sources   Download

MIT

The Requires

 

The Development Requires

testing symfony tests integration tests functional tests