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
5 changes: 3 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ jobs:

- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
run: echo "dir=$(composer config cache-files-dir)" >> "$GITHUB_OUTPUT"

- name: Cache composer dependencies
uses: actions/cache@v5
Expand All @@ -120,7 +120,8 @@ jobs:
restore-keys: ${{ runner.os }}-composer-

- name: Allow dev dependencies
run: if [ "${{ matrix.minimum-stability }}" = "dev" ]; then perl -pi -e 's/^}$/,"minimum-stability":"dev","prefer-stable":true}/' composer.json; fi;
if: matrix.minimum-stability == 'dev'
run: composer config minimum-stability dev && composer config prefer-stable true

- name: Install Composer dependencies
run: composer update --prefer-dist --no-interaction ${{ matrix.composer-flags }}
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Third party
/.php-cs-fixer.cache
/.phpunit.result.cache
/.phpunit.cache
/composer.lock
/vendor

Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

* Added support for Symfony 8.2
* Replaced the `gifexception:optimize` command and `bin/optimizer.php` by the `castor optimize` task
* Upgraded the test suite to PHPUnit 11

## 1.11.1 (2026-05-26)

Expand Down
2 changes: 1 addition & 1 deletion castor.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ function cs(bool $dryRun = false): void
#[AsTask(description: 'Run the test suite')]
function test(): void
{
run('vendor/bin/simple-phpunit');
run('vendor/bin/phpunit');
}

#[AsTask(description: 'Run static analysis')]
Expand Down
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"doctrine/annotations": "^2.0",
"friendsofphp/php-cs-fixer": "^3.17",
"phpstan/phpstan": "^2.1",
"phpunit/phpunit": "^11.5",
"symfony/asset": "^6.4 || ^7.3 || ^8.0",
"symfony/browser-kit": "^6.4 || ^7.3 || ^8.0",
"symfony/config": "^6.4 || ^7.3 || ^8.0",
Expand All @@ -34,7 +35,7 @@
"symfony/error-handler": "^6.4 || ^7.3 || ^8.0",
"symfony/http-kernel": "^6.4 || ^7.3 || ^8.0",
"symfony/monolog-bundle": "^3.8 || ^4.0",
"symfony/phpunit-bridge": "^6.3 || ^7.0",
"symfony/phpunit-bridge": "^7.3 || ^8.0",
"symfony/stopwatch": "^6.4 || ^7.3 || ^8.0",
"symfony/web-profiler-bundle": "^6.4 || ^7.3 || ^8.0",
"symfony/yaml": "^6.4 || ^7.3 || ^8.0"
Expand Down
25 changes: 14 additions & 11 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,22 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- http://phpunit.de/manual/current/en/appendixes.configuration.html -->
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="./vendor/bin/.phpunit/phpunit.xsd"
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
backupGlobals="false"
bootstrap="tests/app/bootstrap.php"
cacheDirectory=".phpunit.cache"
colors="true"
failOnRisky="true"
failOnWarning="true"
>
<coverage processUncoveredFiles="true">
<include>
<directory>.</directory>
</include>
<exclude>
<directory>tests</directory>
<directory>vendor</directory>
</exclude>
</coverage>
<php>
<ini name="display_errors" value="1" />
<ini name="error_reporting" value="-1" />
Expand All @@ -30,4 +21,16 @@
<directory>tests</directory>
</testsuite>
</testsuites>
<source>
<include>
<directory>.</directory>
</include>
<exclude>
<directory>tests</directory>
<directory>vendor</directory>
</exclude>
</source>
<extensions>
<bootstrap class="Symfony\Bridge\PhpUnit\SymfonyExtension" />
</extensions>
</phpunit>
20 changes: 20 additions & 0 deletions tests/FunctionalTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,26 @@

class FunctionalTest extends WebTestCase
{
protected function tearDown(): void
{
parent::tearDown();

// FrameworkBundle::boot() calls ErrorHandler::register() on every kernel boot. Before
// symfony/error-handler 8.1, it left an exception handler registered when another error
// handler (PHPUnit's) was already in charge, which PHPUnit reports as a risky test.
// Remove this once Symfony < 8.1 is dropped.
while (true) {
$previous = set_exception_handler(static fn () => null);
restore_exception_handler();

if (null === $previous) {
break;
}

restore_exception_handler();
}
}

public function testItDoesNotDisplayGifOnExceptionPageIfTheBundleIsNotEnabled(): void
{
$client = static::createClient(['environment' => 'prod', 'debug' => true]);
Expand Down
Loading