From 45aefc5ace92fce9a0a28a54e1e7cee1efcf830b Mon Sep 17 00:00:00 2001 From: Baptiste Langlade Date: Sun, 24 Aug 2025 16:30:38 +0200 Subject: [PATCH] replace phpunit by blackbox --- .github/workflows/ci.yml | 4 +++- .gitignore | 1 - blackbox.php | 27 +++++++++++++++++++++++++++ composer.json | 2 +- phpunit.xml.dist | 18 ------------------ tests/ViaAuthorizationTest.php | 2 +- tests/ViaBasicAuthorizationTest.php | 2 +- tests/ViaFormTest.php | 2 +- tests/ViaUrlAuthorityTest.php | 2 +- 9 files changed, 35 insertions(+), 25 deletions(-) create mode 100644 blackbox.php delete mode 100644 phpunit.xml.dist diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9070d8d..e5384ce 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,7 +26,9 @@ jobs: with: dependency-versions: ${{ matrix.dependencies }} - name: PHPUnit - run: vendor/bin/phpunit --coverage-clover=coverage.clover + run: php blackbox.php + env: + ENABLE_COVERAGE: 'true' - uses: codecov/codecov-action@v1 with: token: ${{ secrets.CODECOV_TOKEN }} diff --git a/.gitignore b/.gitignore index e96516b..987e2a2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,2 @@ composer.lock vendor -.phpunit.result.cache diff --git a/blackbox.php b/blackbox.php new file mode 100644 index 0000000..50022e2 --- /dev/null +++ b/blackbox.php @@ -0,0 +1,27 @@ +when( + \getenv('ENABLE_COVERAGE') !== false, + static fn(Application $app) => $app + ->codeCoverage( + CodeCoverage::of( + __DIR__.'/src/', + __DIR__.'/tests/', + ) + ->dumpTo('coverage.clover') + ->enableWhen(true), + ) + ->scenariiPerProof(1), + ) + ->tryToProve(Load::directory(__DIR__.'/tests/')) + ->exit(); diff --git a/composer.json b/composer.json index 0ad9421..386126d 100644 --- a/composer.json +++ b/composer.json @@ -31,8 +31,8 @@ } }, "require-dev": { - "phpunit/phpunit": "~9.0", "vimeo/psalm": "~5.6", + "innmind/black-box": "~6.5", "innmind/coding-standard": "~2.0" } } diff --git a/phpunit.xml.dist b/phpunit.xml.dist deleted file mode 100644 index 01dbbc9..0000000 --- a/phpunit.xml.dist +++ /dev/null @@ -1,18 +0,0 @@ - - - - - . - - - ./tests - ./vendor - ./src/ViaSession.php - - - - - ./tests - - - diff --git a/tests/ViaAuthorizationTest.php b/tests/ViaAuthorizationTest.php index 90ba5cf..92b0d9f 100644 --- a/tests/ViaAuthorizationTest.php +++ b/tests/ViaAuthorizationTest.php @@ -16,7 +16,7 @@ }; use Innmind\Url\Url; use Innmind\Immutable\Attempt; -use PHPUnit\Framework\TestCase; +use Innmind\BlackBox\PHPUnit\Framework\TestCase; class ViaAuthorizationTest extends TestCase { diff --git a/tests/ViaBasicAuthorizationTest.php b/tests/ViaBasicAuthorizationTest.php index e12ebdf..68798f5 100644 --- a/tests/ViaBasicAuthorizationTest.php +++ b/tests/ViaBasicAuthorizationTest.php @@ -15,7 +15,7 @@ }; use Innmind\Url\Url; use Innmind\Immutable\Attempt; -use PHPUnit\Framework\TestCase; +use Innmind\BlackBox\PHPUnit\Framework\TestCase; class ViaBasicAuthorizationTest extends TestCase { diff --git a/tests/ViaFormTest.php b/tests/ViaFormTest.php index a8f2a50..76f104c 100644 --- a/tests/ViaFormTest.php +++ b/tests/ViaFormTest.php @@ -11,7 +11,7 @@ }; use Innmind\Url\Url; use Innmind\Immutable\Attempt; -use PHPUnit\Framework\TestCase; +use Innmind\BlackBox\PHPUnit\Framework\TestCase; class ViaFormTest extends TestCase { diff --git a/tests/ViaUrlAuthorityTest.php b/tests/ViaUrlAuthorityTest.php index 8048219..efcd1a4 100644 --- a/tests/ViaUrlAuthorityTest.php +++ b/tests/ViaUrlAuthorityTest.php @@ -11,7 +11,7 @@ ProtocolVersion, }; use Innmind\Immutable\Attempt; -use PHPUnit\Framework\TestCase; +use Innmind\BlackBox\PHPUnit\Framework\TestCase; class ViaUrlAuthorityTest extends TestCase {