Skip to content
Merged
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
28 changes: 18 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,19 @@ jobs:
strategy:
fail-fast: false
matrix:
php: [ '7.4', '8.0', '8.1' ]
composer: [ '', '--prefer-lowest' ]
php:
- '7.4'
- '8.0'
- '8.1'
- '8.2'
- '8.3'
- '8.4'
deps:
- 'highest'
- 'lowest'

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Use PHP
uses: shivammathur/setup-php@v2
Expand All @@ -32,22 +40,22 @@ jobs:

- name: cache dependencies
id: cache-dependencies
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-${{ matrix.php }}-${{ matrix.composer }}-composer-${{ hashFiles('**/composer.lock') }}
key: ${{ runner.os }}-${{ matrix.php }}-${{ matrix.deps }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-${{ matrix.php }}-${{ matrix.composer }}-composer-
${{ runner.os }}-${{ matrix.php }}-${{ matrix.deps }}-composer-

- name: Validate composer.json and composer.lock
run: composer validate
working-directory: ./

- name: Install dependencies
env:
COMPOSER_FLAGS: ${{ matrix.composer }}
run: composer update ${COMPOSER_FLAGS} --prefer-source
working-directory: ./
uses: ramsey/composer-install@v3
with:
dependency-versions: '${{ matrix.deps }}'
working-directory: ./


- name: Run Tests
Expand Down
8 changes: 4 additions & 4 deletions Framework/Test/ServiceTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ static private function getPhpUnitCliConfigArgument()
*/
static protected function getKernelClass()
{
$dir = isset($_SERVER['KERNEL_DIR']) ? $_SERVER['KERNEL_DIR'] : static::getPhpUnitXmlDir();
$dir = $_SERVER['KERNEL_DIR'] ?? static::getPhpUnitXmlDir();

$finder = new Finder();
$finder->name('*Kernel.php')->depth(0)->in($dir);
Expand Down Expand Up @@ -123,15 +123,15 @@ static protected function getKernelClass()
*
* @return HttpKernelInterface A HttpKernelInterface instance
*/
static protected function createKernel(array $options = array())
static protected function createKernel(array $options = [])
{
if (null === static::$class) {
static::$class = static::getKernelClass();
}

return new static::$class(
isset($options['environment']) ? $options['environment'] : 'test',
isset($options['debug']) ? $options['debug'] : true
$options['environment'] ?? 'test',
$options['debug'] ?? true
);
}

Expand Down
7 changes: 3 additions & 4 deletions Tests/TestKernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,16 @@ public function getRootDir()
{
return __DIR__.'/Resources';
}
public function registerBundles()
public function registerBundles(): iterable
{
return array(
);
return [];
}
public function registerContainerConfiguration(LoaderInterface $loader)
{
$loader->load(__DIR__.'/Resources/config/config_test.yml');
if (class_exists('Symfony\Component\Asset\Package')) {
$loader->load(function (ContainerBuilder $container) {
$container->loadFromExtension('framework', array('assets' => array()));
$container->loadFromExtension('framework', ['assets' => []]);
});
}
}
Expand Down
9 changes: 5 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,14 @@
],
"require": {
"php": ">=7.4",
"symfony/http-kernel": "^4.4.12|^5.0",
"symfony/http-kernel": "^4.4.12|^5.0|^6.0",
"phpunit/phpunit": "^8.5.23|^9.0"
},
"require-dev": {
"symfony/config": "^4.4.12|^5.0",
"symfony/dependency-injection": "^4.4.12|^5.0",
"symfony/yaml": "^4.4.12|^5.0"
"symfony/config": "^4.4.12|^5.0|^6.0",
"symfony/dependency-injection": "^4.4.12|^5.0|^6.0",
"symfony/yaml": "^4.4.12|^5.0|^6.0",
"rector/rector": "^0.19.0"
},
"autoload": {
"psr-4": {
Expand Down
56 changes: 26 additions & 30 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,39 +1,35 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit backupGlobals="false"
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
backupGlobals="false"
backupStaticAttributes="false"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
syntaxCheck="false"
bootstrap="Tests/autoload.php">

<php>
<ini name="error_reporting" value="-1"/>
<server name="KERNEL_DIR" value="./Tests/" />
</php>

<testsuites>
<testsuite name="ServiceTestHelper Test Suite">
<directory suffix="Test.php">./Tests</directory>
</testsuite>
</testsuites>

<logging>
<log type="junit" target="build/logs/junit.xml"
logIncompleteSkipped="false"/>
</logging>

<filter>
<whitelist>
<directory>./</directory>
<exclude>
<directory>./Tests</directory>
<directory>./vendor</directory>
<directory>./Resources</directory>
</exclude>
</whitelist>
</filter>
bootstrap="Tests/autoload.php"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
<coverage>
<include>
<directory>./</directory>
</include>
<exclude>
<directory>./Tests</directory>
<directory>./vendor</directory>
<directory>./Resources</directory>
</exclude>
</coverage>
<php>
<ini name="error_reporting" value="-1"/>
<server name="KERNEL_DIR" value="./Tests/"/>
</php>
<testsuites>
<testsuite name="ServiceTestHelper Test Suite">
<directory suffix="Test.php">./Tests</directory>
</testsuite>
</testsuites>
<logging>
<junit outputFile="build/logs/junit.xml"/>
</logging>
</phpunit>
Loading