Skip to content

Commit 5050d24

Browse files
Fix CI post-merge PHP 8 (#31)
* Fix CI post-merge PHP 8 * Update .github/workflows/ci.yml * Update .github/workflows/ci.yml * Remove scrutinizer and coverage + update CI Co-authored-by: Tobias Nyholm <[email protected]>
1 parent c612690 commit 5050d24

File tree

3 files changed

+40
-43
lines changed

3 files changed

+40
-43
lines changed

.github/workflows/ci.yml

Lines changed: 26 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -15,24 +15,36 @@ jobs:
1515
strategy:
1616
matrix:
1717
php:
18-
- '5.5'
19-
- '5.6'
20-
- '7.0'
21-
- '7.1'
2218
- '7.2'
2319
- '7.3'
2420
- '7.4'
2521
- '8.0'
22+
dependency:
23+
- ''
24+
- 'lowest'
2625
symfony:
2726
- '3.4.*'
2827
- '4.4.*'
2928
- '5.0.*'
30-
include:
31-
- php: '7.1'
32-
coverage: true
33-
dependency:
34-
- ''
35-
- 'lowest'
29+
exclude:
30+
- php: '7.2'
31+
symfony: '3.4.*'
32+
dependency: 'lowest'
33+
- php: '7.2'
34+
symfony: '4.4.*'
35+
dependency: 'lowest'
36+
- php: '7.3'
37+
symfony: '3.4.*'
38+
- php: '7.3'
39+
symfony: '4.4.*'
40+
- php: '7.4'
41+
symfony: '3.4.*'
42+
- php: '7.4'
43+
symfony: '4.4.*'
44+
- php: '8.0'
45+
symfony: '3.4.*'
46+
- php: '8.0'
47+
symfony: '4.4.*'
3648
fail-fast: false
3749
steps:
3850
- name: Checkout
@@ -42,7 +54,10 @@ jobs:
4254
uses: shivammathur/setup-php@v2
4355
with:
4456
php-version: ${{ matrix.php }}
45-
extensions: curl, dom, iconv, intl, json, libxml, mbstring, phar, tokenizer, xdebug, xml, xmlwriter
57+
extensions: composer:v2, flex, pcov
58+
59+
- name: Configure Symfony
60+
run: composer config extra.symfony.require "${{ matrix.symfony }}"
4661

4762
- name: Get Composer Cache Directory
4863
id: composer-cache
@@ -55,11 +70,6 @@ jobs:
5570
key: ${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }}
5671
restore-keys: ${{ matrix.php }}-composer-
5772

58-
- name: Configure Symfony
59-
run: |
60-
composer global require symfony/flex
61-
composer config extra.symfony.require "${{ matrix.symfony }}"
62-
6373
- name: Update project dependencies
6474
if: matrix.dependency == ''
6575
run: composer update --no-progress --ansi --prefer-stable
@@ -72,15 +82,4 @@ jobs:
7282
run: composer validate --strict --no-check-lock
7383

7484
- name: Run tests
75-
if: !matrix.coverage
7685
run: vendor/bin/phpunit
77-
78-
- name: Run tests with coverage
79-
if: matrix.coverage
80-
run: vendor/bin/phpunit --coverage-text --coverage-clover=build/coverage.xml
81-
82-
- name: Upload coverage
83-
if: matrix.coverage
84-
run: |
85-
wget https://scrutinizer-ci.com/ocular.phar
86-
php ocular.phar code-coverage:upload --format=php-clover build/coverage.xml

Readme.md

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,16 @@
22

33
[![Latest Version](https://img.shields.io/github/release/Nyholm/symfony-bundle-test.svg?style=flat-square)](https://github.com/Nyholm/symfony-bundle-test/releases)
44
[![Build Status](https://img.shields.io/travis/SymfonyTest/symfony-bundle-test/master.svg?style=flat-square)](https://travis-ci.org/SymfonyTest/symfony-bundle-test)
5-
[![Code Coverage](https://img.shields.io/scrutinizer/coverage/g/Nyholm/symfony-bundle-test.svg?style=flat-square)](https://scrutinizer-ci.com/g/Nyholm/symfony-bundle-test)
6-
[![Quality Score](https://img.shields.io/scrutinizer/g/Nyholm/symfony-bundle-test.svg?style=flat-square)](https://scrutinizer-ci.com/g/Nyholm/symfony-bundle-test)
75
[![Total Downloads](https://img.shields.io/packagist/dt/nyholm/symfony-bundle-test.svg?style=flat-square)](https://packagist.org/packages/nyholm/symfony-bundle-test)
86

97
**Test if your bundle is compatible with different Symfony versions**
108

119
When you want to make sure that your bundle works with different versions of Symfony
12-
you need to create a custom `AppKernel` and load your bundle and configuration.
10+
you need to create a custom `AppKernel` and load your bundle and configuration.
1311

14-
Using this bundle test together with Matthias Nobacks's
12+
Using this bundle test together with Matthias Nobacks's
1513
[SymfonyDependencyInjectionTest](https://github.com/SymfonyTest/SymfonyDependencyInjectionTest)
16-
will give you a good base for testing a Symfony bundle.
14+
will give you a good base for testing a Symfony bundle.
1715

1816
## Install
1917

@@ -42,7 +40,7 @@ class BundleInitializationTest extends BaseBundleTestCase
4240
{
4341
// Boot the kernel.
4442
$this->bootKernel();
45-
43+
4644
// Get the container
4745
$container = $this->getContainer();
4846

@@ -51,22 +49,22 @@ class BundleInitializationTest extends BaseBundleTestCase
5149
$service = $container->get('acme.foo');
5250
$this->assertInstanceOf(Foo::class, $service);
5351
}
54-
52+
5553
public function testBundleWithDifferentConfiguration()
5654
{
5755
// Create a new Kernel
5856
$kernel = $this->createKernel();
59-
57+
6058
// Add some configuration
6159
$kernel->addConfigFile(__DIR__.'/config.yml');
62-
60+
6361
// Add some other bundles we depend on
6462
$kernel->addBundle(OtherBundle::class);
6563

6664
// Boot the kernel as normal ...
6765
$this->bootKernel();
68-
69-
// ...
66+
67+
// ...
7068
}
7169
}
7270

@@ -75,18 +73,18 @@ class BundleInitializationTest extends BaseBundleTestCase
7573
## Private services in Symfony 4
7674

7775
In Symfony 4 services are private by default. This is a good thing, but in order to test them properly we need to make
78-
them public when we are running the tests. This can easily be done with a compiler pass.
76+
them public when we are running the tests. This can easily be done with a compiler pass.
7977

8078
```php
8179
class BundleInitializationTest extends BaseBundleTestCase
8280
{
8381
protected function setUp()
8482
{
8583
parent::setUp();
86-
84+
8785
// Make all services public
8886
$this->addCompilerPass(new PublicServicePass());
89-
87+
9088
// Make services public that have an idea that matches a regex
9189
$this->addCompilerPass(new PublicServicePass('|my_bundle.*|'));
9290
}
@@ -101,7 +99,7 @@ Be aware that if you make all services public then you will not get any errors i
10199

102100
## Configure Travis
103101

104-
You want Travis to run against each currently supported LTS version of Symfony (since there would be only one per major version), plus the current if it's not an LTS too. There is no need for testing against version in between because Symfony follows [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
102+
You want Travis to run against each currently supported LTS version of Symfony (since there would be only one per major version), plus the current if it's not an LTS too. There is no need for testing against version in between because Symfony follows [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
105103

106104
```yaml
107105
language: php

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"symfony/yaml": "^3.4 || ^4.3 || ^5.0"
1818
},
1919
"require-dev": {
20-
"phpunit/phpunit": "^4.8.36 || ^5.5 || ^6.2"
20+
"phpunit/phpunit": "^8.5 || ^9.4"
2121
},
2222
"autoload": {
2323
"psr-4": { "Nyholm\\BundleTest\\": "src/" }

0 commit comments

Comments
 (0)