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
41 changes: 41 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: PHP Tests

on: [push, pull_request]

jobs:
tests:
name: 'Tests PHP ${{ matrix.php }}'
runs-on: ubuntu-latest
continue-on-error: ${{ matrix.experimental }}
strategy:
fail-fast: false
matrix:
php: [7.4, 8.0, 8.1, 8.2, 8.3]
experimental: [false]

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

- name: Set up PHP ${{ matrix.php }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}

- name: Validate composer.json and composer.lock
run: composer validate --strict

- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v4
with:
path: vendor
key: ${{ runner.os }}-php${{ matrix.php }}-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php${{ matrix.php }}-

- name: Install dependencies
run: composer install --prefer-dist --no-progress --no-interaction

- name: Tests
run: vendor/bin/phpunit
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
composer.lock
/vendor/
.phpunit*.cache
2 changes: 1 addition & 1 deletion Tests/NullableEmbeddable/ClosureNullatorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ final class ClosureNullatorTest extends TestCase
*/
private $listener;

protected function setUp()
protected function setUp(): void
{
$this->listener = NullableEmbeddableListenerFactory::createWithClosureNullator();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ final class NullableEmbeddableListenerTest extends TestCase
*/
private $listener;

protected function setUp()
protected function setUp(): void
{
$this->listener = NullableEmbeddableListenerFactory::createWithPropertyAccessor();
}
Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@

"minimum-stability": "stable",
"require": {
"php": "^7.0",
"symfony/property-access": "^3.2|^4.0"
"php": "^7.2 || ^8.0",
"symfony/property-access": "^3.2 || ^4.0 || ^5.0 || ^6.0 || ^7.0"
},
"require-dev": {
"phpunit/phpunit": "^5.7"
"phpunit/phpunit": "^8.5 || ^9.5 || ^10.0"
}
}
55 changes: 27 additions & 28 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,33 +1,32 @@
<?xml version="1.0" encoding="UTF-8"?>

<!-- https://phpunit.de/documentation.html -->
<phpunit
backupGlobals = "false"
backupStaticAttributes = "false"
colors = "true"
convertErrorsToExceptions = "true"
convertNoticesToExceptions = "true"
convertWarningsToExceptions = "true"
processIsolation = "false"
stopOnFailure = "true"
stopOnError = "true"
syntaxCheck = "false"
forceCoversAnnotation = "true"
bootstrap = "./vendor/autoload.php">

<testsuites>
<testsuite>
<directory>./Tests</directory>
</testsuite>
</testsuites>
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/8.5/phpunit.xsd"
backupGlobals="false"
backupStaticAttributes="false"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="true"
stopOnError="true"
forceCoversAnnotation="true"
bootstrap="./vendor/autoload.php">
<testsuites>
<testsuite name="default">
<directory>./Tests</directory>
</testsuite>
</testsuites>

<filter>
<whitelist>
<directory>.</directory>
<exclude>
<directory>./Tests</directory>
<directory suffix="Interface.php">./*</directory>
</exclude>
</whitelist>
</filter>
<filter>
<whitelist>
<directory>.</directory>
<exclude>
<directory>./Tests</directory>
<directory suffix="Interface.php">./*</directory>
</exclude>
</whitelist>
</filter>
</phpunit>