Skip to content

Commit def127d

Browse files
authored
Misc. readme and CI updates before release (#170)
1 parent b9d8df2 commit def127d

File tree

2 files changed

+43
-21
lines changed

2 files changed

+43
-21
lines changed

.github/workflows/ci.yaml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,23 +22,27 @@ jobs:
2222
- '5.4.*'
2323
- '6.4.*'
2424
- '7.4.*'
25+
- '8.0.*'
2526
include:
2627
- php: '8.1'
2728
symfony: '5.4.*'
2829
dependency: 'lowest'
2930
- php: '8.4'
3031
symfony: '7.4.*'
3132
dependency: ''
32-
- php: '8.5'
33-
symfony: '8.0.*'
34-
dependency: ''
3533
exclude:
3634
- php: '8.1'
3735
symfony: '7.4.*'
36+
- php: '8.1'
37+
symfony: '8.0.*'
38+
- php: '8.2'
39+
symfony: '8.0.*'
40+
- php: '8.3'
41+
symfony: '8.0.*'
3842
fail-fast: false
3943
steps:
4044
- name: Checkout
41-
uses: actions/checkout@v4
45+
uses: actions/checkout@v6
4246

4347
- name: Setup PHP
4448
uses: shivammathur/setup-php@v2

README.md

Lines changed: 35 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,17 @@ Basically you will be testing your extension's load method, which will look some
4949
```php
5050
<?php
5151

52+
use Symfony\Component\Config\FileLocator;
53+
use Symfony\Component\DependencyInjection\ContainerBuilder;
54+
use Symfony\Component\DependencyInjection\Extension\Extension;
55+
use Symfony\Component\DependencyInjection\Loader\PhpFileLoader;
56+
5257
class MyExtension extends Extension
5358
{
5459
public function load(array $config, ContainerBuilder $container)
5560
{
56-
$loader = new XmlFileLoader($container, new FileLocator(__DIR__));
57-
$loader->load('services.xml');
61+
$loader = new PhpFileLoader($container, new FileLocator(__DIR__));
62+
$loader->load('services.php');
5863

5964
// maybe process the configuration values in $config, then:
6065

@@ -68,11 +73,12 @@ So in the test case you should test that after loading the container, the parame
6873
```php
6974
<?php
7075

76+
use Matthias\SymfonyDependencyInjectionTest\PhpUnit\AbstractExtensionTestCase;
77+
use PHPUnit\Framework\Attributes\Test;
78+
7179
class MyExtensionTest extends AbstractExtensionTestCase
7280
{
73-
/**
74-
* @test
75-
*/
81+
#[Test]
7682
public function after_loading_the_correct_parameter_has_been_set()
7783
{
7884
$this->load();
@@ -87,11 +93,12 @@ To test the effect of different configuration values, use the first argument of
8793
```php
8894
<?php
8995

96+
use Matthias\SymfonyDependencyInjectionTest\PhpUnit\AbstractExtensionTestCase;
97+
use PHPUnit\Framework\Attributes\Test;
98+
9099
class MyExtensionTest extends AbstractExtensionTestCase
91100
{
92-
/**
93-
* @test
94-
*/
101+
#[Test]
95102
public function after_loading_the_correct_parameter_has_been_set()
96103
{
97104
$this->load(['my' => ['enabled' => 'false']);
@@ -113,6 +120,7 @@ To test a compiler pass, create a test class and extend from
113120
<?php
114121

115122
use Matthias\SymfonyDependencyInjectionTest\PhpUnit\AbstractCompilerPassTestCase;
123+
use Symfony\Component\DependencyInjection\ContainerBuilder;
116124

117125
class MyCompilerPassTest extends AbstractCompilerPassTestCase
118126
{
@@ -132,11 +140,13 @@ instance.
132140
```php
133141
<?php
134142

143+
use PHPUnit\Framework\Attributes\Test;
144+
use Symfony\Component\DependencyInjection\Definition;
145+
use Symfony\Component\DependencyInjection\Reference;
146+
135147
class MyCompilerPassTest extends AbstractCompilerPassTestCase
136148
{
137-
/**
138-
* @test
139-
*/
149+
#[Test]
140150
public function if_compiler_pass_collects_services_by_adding_method_calls_these_will_exist()
141151
{
142152
$collectingService = new Definition();
@@ -250,6 +260,16 @@ twig:
250260
extensions: ['twig.extension.foo']
251261
```
252262
263+
```php
264+
<?php // in Fixtures/config.php
265+
266+
return App::config([
267+
'twig' => [
268+
'extensions' => ['twig.extension.foo']
269+
],
270+
]);
271+
```
272+
253273
```xml
254274
<!-- in Fixtures/config.xml -->
255275
<container>
@@ -261,15 +281,13 @@ twig:
261281

262282
```php
263283
<?php
264-
...
284+
285+
use Matthias\SymfonyDependencyInjectionTest\PhpUnit\AbstractExtensionConfigurationTestCase;
286+
use PHPUnit\Framework\Attributes\Test;
265287

266288
class ConfigurationTest extends AbstractExtensionConfigurationTestCase
267289
{
268-
...
269-
270-
/**
271-
* @test
272-
*/
290+
#[Test]
273291
public function it_converts_extension_elements_to_extensions()
274292
{
275293
$expectedConfiguration = [

0 commit comments

Comments
 (0)