Closed benfreke closed 1 month ago
I cannot reproduce this.
composer.json
{
"require-dev": {
"phpunit/phpunit": "^11.3"
}
}
phpunit.xml
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
bootstrap="vendor/autoload.php"
cacheDirectory=".phpunit.cache"
executionOrder="depends,defects"
shortenArraysForExportThreshold="10"
requireCoverageMetadata="true"
beStrictAboutCoverageMetadata="true"
beStrictAboutOutputDuringTests="true"
displayDetailsOnPhpunitDeprecations="true"
failOnPhpunitDeprecation="true"
failOnRisky="true"
failOnWarning="true">
<testsuites>
<testsuite name="default">
<directory>tests</directory>
</testsuite>
</testsuites>
<source ignoreIndirectDeprecations="true" restrictNotices="true" restrictWarnings="true">
<include>
<directory>src</directory>
</include>
</source>
</phpunit>
tests/Issue5971Test.php
<?php declare(strict_types=1);
namespace PHPUnit\TestFixture\Issue5971;
use PHPUnit\Framework\Attributes\CoversNothing;
use PHPUnit\Framework\TestCase;
#[CoversNothing]
final class Issue5971Test extends TestCase
{
public function testOne(): void
{
$this->assertTrue(true);
}
}
❯ ./vendor/bin/phpunit --display-phpunit-deprecations
PHPUnit 11.3.6 by Sebastian Bergmann and contributors.
Runtime: PHP 8.3.12
Configuration: /tmp/5971/phpunit.xml
. 1 / 1 (100%)
Time: 00:00.004, Memory: 8.00 MB
OK (1 test, 1 assertion)
No feedback, closing.
Summary
Running phpunit with the option
--display-phpunit-deprecations
shows the warning1) Your XML configuration validates against a deprecated schema. Migrate your XML configuration using "--migrate-configuration"!
This is because I have updated the schema to be the path to the XSD that is downloaded with phpunit. The line in my phpunit.xml file is
Phpunit says that this is invalid and I should instead be pointing at a link on the internet to the 11.3 version of the file. Phpstorm complains if I haven't downloaded this locally, which is why I changed it to the local version so it would always be up to date. Those files should be exactly the same and therefore I think this deprecation is incorrect?
When I run the tool, that value is the only change made.
Current behavior
Phpunit complains that the local XSD for the phpunit.xml is deprecated.
How to reproduce
xsi:noNamespaceSchemaLocation
to bevendor/phpunit/phpunit/phpunit.xsd
--display-phpunit-deprecations
Expected behavior
No deprecation warnings during a standard run of phpunit, and nothing displayed with the option
--display-phpunit-deprecations