Skip to content

Running Unit tests on source code itself #710

@llaville

Description

@llaville

I've noticed at least two issues when trying to run unit tests on project source code itself.

With main branch (commit 36225d36071cb0e7aae3e05a8baa82ace28e1094)

When we run

vendor/bin/phpunit -c test/Unit/phpunit.xml

We got a warning about schema used, because it reference v7.2 (@see f566c89) while we run PHPUnit 9.6 runtime

PHPUnit 9.6.19 by Sebastian Bergmann and contributors.

Runtime:       PHP 8.3.6
Configuration: test/Unit/phpunit.xml
Warning:       Your XML configuration validates against a deprecated schema.
Suggestion:    Migrate your XML configuration using "--migrate-configuration"!

........................................................................................................................................................................... 171 / 226 ( 75%)
.......................................................                                                                                                                     226 / 226 (100%)

Time: 00:00.076, Memory: 10.00 MB

OK (226 tests, 330 assertions)

And when we run basic PHPUnit without config file (trying to auto-detect)

vendor/bin/phpunit test/Unit/

We got

PHPUnit 9.6.19 by Sebastian Bergmann and contributors.

...............................................................  63 / 226 ( 27%)
............................................................... 126 / 226 ( 55%)
............................................................... 189 / 226 ( 83%)
.....................................                           226 / 226 (100%)

Time: 00:00.038, Memory: 8.00 MB

OK (226 tests, 330 assertions)

And when we try to run

vendor/bin/phpunit test

We got

PHP Fatal error:  Declaration of Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\Version06\TestCase\Combination\SleeperTest::setUpBeforeClass() must be compatible with PHPUnit\Framework\TestCase::setUpBeforeClass(): void in /home/devilbox/data/phpunit-slow-test-detector/test/EndToEnd/Version06/TestCase/Combination/SleeperTest.php on line 24

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions