Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 12 additions & 7 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,29 +15,34 @@ jobs:
- '8.2'
- '8.3'
- '8.4'
- '8.5'
dependency:
- ''
symfony:
- '5.4.*'
- '6.4.*'
- '7.3.*'
- '7.4.*'
- '8.0.*'
include:
- php: '8.1'
symfony: '5.4.*'
dependency: 'lowest'
- php: '8.4'
symfony: '7.4.*@dev'
dependency: ''
- php: '8.4'
symfony: '8.0.*@dev'
dependency: ''
exclude:
- php: '8.1'
symfony: '7.3.*'
- php: '8.1'
symfony: '7.4.*'
- php: '8.1'
symfony: '8.0.*'
- php: '8.2'
symfony: '8.0.*'
- php: '8.3'
symfony: '8.0.*'
fail-fast: false
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v6

- name: Setup PHP
uses: shivammathur/setup-php@v2
Expand Down
24 changes: 10 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ validity of the resulting config node tree, this library provides a PHPUnit test

Using Composer:

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

## Usage

Expand All @@ -22,9 +24,9 @@ Then implement ``getConfiguration()``:
```php
<?php

use App\Configuration;
use Matthias\SymfonyConfigTest\PhpUnit\ConfigurationTestCaseTrait;
use PHPUnit\Framework\TestCase;
use App\Configuration;

class ConfigurationTest extends TestCase
{
Expand Down Expand Up @@ -75,15 +77,14 @@ When you provide an empty array as the value for this configuration, you would e
<?php

use Matthias\SymfonyConfigTest\PhpUnit\ConfigurationTestCaseTrait;
use PHPUnit\Framework\Attributes\Test;
use PHPUnit\Framework\TestCase;

class ConfigurationTest extends TestCase
{
use ConfigurationTestCaseTrait;

/**
* @test
*/
#[Test]
public function values_are_invalid_if_required_value_is_not_provided(): void
{
$this->assertConfigurationIsInvalid(
Expand All @@ -104,15 +105,14 @@ You may also want to verify that after processing an array of configuration valu
<?php

use Matthias\SymfonyConfigTest\PhpUnit\ConfigurationTestCaseTrait;
use PHPUnit\Framework\Attributes\Test;
use PHPUnit\Framework\TestCase;

class ConfigurationTest extends TestCase
{
use ConfigurationTestCaseTrait;

/**
* @test
*/
#[Test]
public function processed_value_contains_required_value(): void
{
$this->assertProcessedConfigurationEquals([
Expand Down Expand Up @@ -177,9 +177,7 @@ If you want to test, for instance, only the `array_node_1` branch from the examp
provide `array_node_1` as the argument for the `$breadcrumbPath` parameter of the test helper functions, for example:

```php
/**
* @test
*/
#[Test]
public function processed_configuration_for_array_node_1(): void
{
$this->assertProcessedConfigurationEquals(
Expand Down Expand Up @@ -244,9 +242,7 @@ If you want to test whether `default_value` is set to `foobar` by default, but d
requirements on `required_value` node, you can define its path as `array_node.*.default_value`, for example:

```php
/**
* @test
*/
#[Test]
public function processed_configuration_for_array_node_1(): void
{
$this->assertProcessedConfigurationEquals(
Expand Down