Open greg0ire opened 9 months ago
Would this properly report deprecations or is this broken due to symfony/phpunit-bridge being incompatible with PHPUnit 10 ?
It seems to be working:
$ git diff
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
modified: Broker/Publisher.php
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
@ Broker/Publisher.php:33 @ public function __construct(FactoryInterface $factory, EventDispatcherInterface
public function publish(string $messageType, Message $message, array $overridenConfig = []): void
{
@trigger_error('this is a test', E_USER_DEPRECATED);
if (!$this->isKnownMessageType($messageType)) {
throw new \InvalidArgumentException(sprintf('Unknown message type "%s". Available are [%s].', $messageType, implode(',', array_keys($this->messageTypes))));
}
╭─~/dev/SwarrotBundle on maintenance ✘ (fork/maintenance)
╰$ vendor/bin/phpunit
PHPUnit 10.5.2 by Sebastian Bergmann and contributors.
Runtime: PHP 8.2.13
Configuration: /home/gregoire/dev/SwarrotBundle/phpunit.xml.dist
....SSSSS..S..................................................... 65 / 81 ( 80%)
.........SSSS... 81 / 81 (100%)
Time: 00:00.085, Memory: 16.00 MB
There was 1 PHPUnit test runner deprecation:
1) Your XML configuration validates against a deprecated schema. Migrate your XML configuration using "--migrate-configuration"!
OK, but there were issues!
Tests: 81, Assertions: 139, Deprecations: 1, Skipped: 10.
Remaining self deprecation notices (1)
1x: this is a test
1x in PublisherTest::testPublishWithUnknownMessageType from Swarrot\SwarrotBundle\Tests\Broker
Is that what you would test, or were you thinking of a more complex scenario?
While it does not mean that we can use the latest features, it means we can spot and address deprecations earlier. It also means the output of composer outdated is smaller, which in turns allows us to spot where work is needed more easily. Note that it also means running phpunit now also produces a warning about validating against a deprecated schema, and I do not think we can address it until we drop support for PHP <= 8.1, since PHPUnit 10 requires PHP 8.1+
Output of
composer outdated
: