Download the PHP package matthiasnoback/symfony-config-test without Composer

On this page you can find all versions of the php package matthiasnoback/symfony-config-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 symfony-config-test

Symfony Config Test

By Matthias Noback and contributors

Build Status

Writing configuration classes using the Symfony Config Component can be quite hard. To help you verify the validity of the resulting config node tree, this library provides a PHPUnit test case and some custom assertions.

Installation

Using Composer:

composer require --dev matthiasnoback/symfony-config-test

Usage

Create a test case and use the trait from Matthias\SymfonyConfigTest\PhpUnit\ConfigurationTestCaseTrait. Then implement getConfiguration():

Test invalid configuration values

Let's assume the Configuration class you want to test looks like this:

When you provide an empty array as the value for this configuration, you would expect an exception since the required_value node is required. You can assert that a given set of configuration values is invalid using the assertConfigurationIsInvalid() method:

Test processed configuration values

You may also want to verify that after processing an array of configuration values the result will be as expected:

Please note: the first argument of each of the assert* methods is an array of arrays. The extra nesting level allows you to test the merge process. See also the section Merging options of the Config Component documentation.

Test a subset of the configuration tree

Using this library it's possible to test just one branch of your configuration tree. Consider the following node tree definition, which contains the branches array_node_1 and array_node_2:

If you want to test, for instance, only the array_node_1 branch from the example below, and ignore the array_node_2, provide array_node_1 as the argument for the $breadcrumbPath parameter of the test helper functions, for example:

This would trigger no validation errors for any value in the array_node_2 branch.

Note that the $breadcrumbPath can be even more specific, e.g. "doctrine.orm" (which would skip configuration processing for branch "doctrine.dbal", etc.).

Also note that you can only traverse over array nodes using the . in the breadcrumb path. The last part of the breadcrumb path can be any other type of node.

Test a subset of the prototyped configuration tree

You can traverse through prototype array nodes using * as its name in the breadcrumb path.

If you want to test whether default_value is set to foobar by default, but don't want the test to be affected by requirements on required_value node, you can define its path as array_node.*.default_value, for example:

Version Guidance

Version Released PHPUnit Status
4.x Mar 5, 2018 7.x and 8.x and 9.x Latest
3.x Nov 30, 2017 6.x   Bugfixes
2.x Jun 18, 2016 4.x and 5.x EOL
1.x Oct 12, 2014 3.x EOL

All versions of symfony-config-test with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
symfony/config Version ^5.4 || ^6.2 || ^7.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 matthiasnoback/symfony-config-test contains the following files

Loading the files please wait ....