Skip to content

Commit

Permalink
Allow Symfony 7 (see #56)
Browse files Browse the repository at this point in the history
  • Loading branch information
Toflar authored Jun 13, 2024
1 parent 06b53b7 commit 913fb47
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 69 deletions.
65 changes: 13 additions & 52 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,16 @@ jobs:
coverage: pcov

- name: Checkout
uses: actions/checkout@v1
uses: actions/checkout@v4

- name: Install the dependencies
run: composer install --no-interaction --no-progress
uses: ramsey/composer-install@v3

- name: Generate the coverage report
run: php -d pcov.enabled=1 vendor/bin/phpunit --testsuite=coverage --coverage-clover=clover.xml --colors=always

- name: Upload the coverage report
uses: codecov/codecov-action@v2
uses: codecov/codecov-action@v4
with:
files: ./clover.xml
fail_ci_if_error: true
Expand All @@ -51,12 +51,15 @@ jobs:
coverage: none

- name: Checkout
uses: actions/checkout@v1
uses: actions/checkout@v4

- name: Install the dependencies
run: |
composer install --no-interaction --no-progress
composer bin ecs install --no-interaction --no-progress
uses: ramsey/composer-install@v3

- name: Install ECS
uses: ramsey/composer-install@v3
with:
working-directory: tools/ecs

- name: Check the coding style
run: tools/ecs/vendor/bin/ecs check src tests --no-progress-bar --ansi
Expand All @@ -68,7 +71,7 @@ jobs:
strategy:
fail-fast: false
matrix:
php: [7.2, 7.3, 7.4, 8.0, 8.1]
php: [7.4, 8.0, 8.1, 8.2, 8.3]
steps:
- name: Setup PHP
uses: shivammathur/setup-php@v2
Expand All @@ -78,52 +81,10 @@ jobs:
coverage: none

- name: Checkout
uses: actions/checkout@v1

- name: Install the dependencies
run: composer install --no-interaction --no-progress

- name: Run the unit tests
run: vendor/bin/phpunit --colors=always

nightly:
name: PHP 8.2
runs-on: ubuntu-latest
if: github.event_name != 'push'
steps:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.0
extensions: dom, fileinfo, filter, gd, hash, intl, json, mbstring, mysqli, pcre, pdo_mysql, zlib
coverage: none

- name: Checkout
uses: actions/checkout@v1

- name: Install the dependencies
run: composer install --ignore-platform-req=php --no-interaction --no-progress

- name: Run the unit tests
run: vendor/bin/phpunit --colors=always

prefer-lowest:
name: Prefer Lowest
runs-on: ubuntu-latest
if: github.event_name != 'push'
steps:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 7.4
extensions: dom, fileinfo, filter, gd, hash, intl, json, mbstring, mysqli, pcre, pdo_mysql, zlib
coverage: none

- name: Checkout
uses: actions/checkout@v1
uses: actions/checkout@v4

- name: Install the dependencies
run: composer update --prefer-lowest --prefer-stable --no-interaction --no-progress
uses: ramsey/composer-install@v3

- name: Run the unit tests
run: vendor/bin/phpunit --colors=always
15 changes: 8 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
"require": {
"php": "^7.1 || ^8.0",
"composer-plugin-api": "^1.7 || ^2.0",
"symfony/config": "^3.3 || ^4.0 || ^5.0 || ^6.0",
"symfony/dependency-injection": "^3.3 || ^4.0 || ^5.0 || ^6.0",
"symfony/filesystem": "^3.3 || ^4.0 || ^5.0 || ^6.0",
"symfony/http-kernel": "^3.3 || ^4.0 || ^5.0 || ^6.0",
"symfony/routing": "^3.3 || ^4.0 || ^5.0 || ^6.0"
"symfony/config": "^3.3 || ^4.0 || ^5.0 || ^6.0 || ^7.0",
"symfony/dependency-injection": "^3.3 || ^4.0 || ^5.0 || ^6.0 || ^7.0",
"symfony/filesystem": "^3.3 || ^4.0 || ^5.0 || ^6.0 || ^7.0",
"symfony/http-kernel": "^3.3 || ^4.0 || ^5.0 || ^6.0 || ^7.0",
"symfony/routing": "^3.3 || ^4.0 || ^5.0 || ^6.0 || ^7.0"
},
"require-dev": {
"ext-zip": "*",
Expand All @@ -25,7 +25,7 @@
"contao/core-bundle": "^4.4 || ^5.0",
"php-http/guzzle6-adapter": "^1.1",
"phpunit/phpunit": "^8.5 || ^9.3",
"symfony/phpunit-bridge": "^3.4.40 || ^4.0 || ^5.0 || ^6.0",
"symfony/phpunit-bridge": "^3.4.40 || ^4.0 || ^5.0 || ^6.0 || ^7.0",
"webmozart/path-util": "^2.0"
},
"conflict": {
Expand All @@ -45,7 +45,8 @@
"allow-plugins": {
"bamarni/composer-bin-plugin": true,
"composer/package-versions-deprecated": true,
"contao-components/installer": false
"contao-components/installer": false,
"php-http/discovery": false
}
},
"extra": {
Expand Down
13 changes: 3 additions & 10 deletions tests/Bundle/Parser/IniParserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public function testParsesRequires(): void
/** @var array<ConfigInterface> $configs */
$configs = $this->parser->parse('with-requires');

$this->assertCount(4, $configs);
$this->assertCount(2, $configs);
$this->assertInstanceOf(ConfigInterface::class, $configs[0]);

$this->assertSame('with-requires', $configs[0]->getName());
Expand Down Expand Up @@ -118,19 +118,12 @@ public function testParsesIniFilesWithoutRequires(): void
$this->assertTrue($configs[0]->loadInDevelopment());
}

public function testParsesNonExistingDirectories(): void
public function testIgnoresNonExistingDirectories(): void
{
/** @var array<ConfigInterface> $configs */
$configs = $this->parser->parse('foobar');

$this->assertCount(1, $configs);
$this->assertInstanceOf(ConfigInterface::class, $configs[0]);

$this->assertSame('foobar', $configs[0]->getName());
$this->assertSame([], $configs[0]->getReplace());
$this->assertNotEmpty($configs[0]->getLoadAfter());
$this->assertTrue($configs[0]->loadInProduction());
$this->assertTrue($configs[0]->loadInDevelopment());
$this->assertCount(0, $configs);
}

/**
Expand Down

0 comments on commit 913fb47

Please sign in to comment.