benholmen / defrag

Disk defrag output for PHPUnit tests

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Bug]: Element 'bootstrap': This element is not expected. Expected is ( extension ).

esurov opened this issue · comments

What happened?

PHPUnit 9.6.11 by Sebastian Bergmann and contributors.

Warning - The configuration file did not pass validation!
The following problems have been detected:

Line 20:

  • Element 'bootstrap': This element is not expected. Expected is ( extension ).

Test results may not be as expected.

How to reproduce the bug

Just did as the readme says:

composer require benholmen/defrag --dev

added extensions to the phpunit.xml

<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" colors="true" bootstrap="vendor/autoload.php" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
  <coverage includeUncoveredFiles="true">
    <include>
      <directory suffix=".php">src</directory>
    </include>
    <exclude>
      <directory suffix=".php">src/Model</directory>
    </exclude>
  </coverage>
  <testsuites>
    <testsuite name="Microsoft Dynamics SDK Test Suite">
      <directory>tests</directory>
    </testsuite>
  </testsuites>
  <extensions>
    <extension class="BenHolmen\Defrag\Extension"/>
  </extensions>
</phpunit>

and launched with vendor/bin/phpunit

Package Version

0.1.4

PHP Version

8.1.25

Which operating systems does with happen with?

Linux

Notes

I have also tried converting <bootstrap> tag into <extension> but then it complaints about: Interface "PHPUnit\Runner\Extension\Extension" not found

Looks like it doesn't work with PHPUnit versions < 10.
I had the same issue with 9.6.11, but after upgrading to PHPUnit 10.4, evrything works like expected.

Thanks for the report! This package uses the event system that is new in PHPUnit v10, so I don't support older versions.

#4 makes this more explicit when requiring the package.