diff --git a/.gitattributes b/.gitattributes index 7d503af..1da7dcc 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,5 +1,4 @@ /.gitattributes export-ignore /.gitignore export-ignore -/phpunit.xml.dist export-ignore /fixtures export-ignore /tests export-ignore diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c655b68..dd25681 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,7 +8,7 @@ jobs: strategy: matrix: os: [ubuntu-latest, macOS-latest] - php-version: ['8.1', '8.2', '8.3'] + php-version: ['8.2', '8.3'] name: 'PHPUnit' steps: - name: Checkout @@ -22,7 +22,9 @@ jobs: - name: Composer uses: "ramsey/composer-install@v2" - 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 }} @@ -30,7 +32,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - php-version: ['8.1', '8.2', '8.3'] + php-version: ['8.2', '8.3'] name: 'Psalm' steps: - name: Checkout @@ -48,7 +50,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - php-version: ['8.1'] + php-version: ['8.2'] name: 'CS' steps: - name: Checkout diff --git a/.gitignore b/.gitignore index eb0a8e7..ff72e2d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,2 @@ /composer.lock /vendor -/.phpunit.result.cache diff --git a/CHANGELOG.md b/CHANGELOG.md index 15e78f3..778dd53 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ## [Unreleased] +### Changed + +- Requires PHP `~8.2` + ### Fixed - PHP `8.4` deprecations diff --git a/blackbox.php b/blackbox.php new file mode 100644 index 0000000..5c3ddce --- /dev/null +++ b/blackbox.php @@ -0,0 +1,28 @@ +disableMemoryLimit() + ->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 5797d04..d5c4a38 100644 --- a/composer.json +++ b/composer.json @@ -33,7 +33,7 @@ } }, "require-dev": { - "phpunit/phpunit": "~9.0", + "innmind/black-box": "^6.4.1", "vimeo/psalm": "~5.6", "innmind/coding-standard": "~2.0", "symfony/var-dumper": "^6.2" diff --git a/phpunit.xml.dist b/phpunit.xml.dist deleted file mode 100644 index 1b3432d..0000000 --- a/phpunit.xml.dist +++ /dev/null @@ -1,17 +0,0 @@ - - - - - . - - - ./tests - ./vendor - - - - - ./tests - - - diff --git a/tests/GraphTest.php b/tests/GraphTest.php index e37177e..3c5fb61 100644 --- a/tests/GraphTest.php +++ b/tests/GraphTest.php @@ -11,7 +11,7 @@ Relation\Property, }; use Innmind\Immutable\Set; -use PHPUnit\Framework\TestCase; +use Innmind\BlackBox\PHPUnit\Framework\TestCase; class GraphTest extends TestCase { diff --git a/tests/LookupTest.php b/tests/LookupTest.php index 60ce041..26e7f3e 100644 --- a/tests/LookupTest.php +++ b/tests/LookupTest.php @@ -5,7 +5,7 @@ use Innmind\ObjectGraph\Lookup; use Fixtures\Innmind\ObjectGraph\Foo; -use PHPUnit\Framework\TestCase; +use Innmind\BlackBox\PHPUnit\Framework\TestCase; class LookupTest extends TestCase { diff --git a/tests/Node/ClassNameTest.php b/tests/Node/ClassNameTest.php index 75550bd..1ecd91a 100644 --- a/tests/Node/ClassNameTest.php +++ b/tests/Node/ClassNameTest.php @@ -4,7 +4,7 @@ namespace Tests\Innmind\ObjectGraph\Node; use Innmind\ObjectGraph\Node\ClassName; -use PHPUnit\Framework\TestCase; +use Innmind\BlackBox\PHPUnit\Framework\TestCase; class ClassNameTest extends TestCase { diff --git a/tests/Node/ReferenceTest.php b/tests/Node/ReferenceTest.php index c38a206..3ab5dcf 100644 --- a/tests/Node/ReferenceTest.php +++ b/tests/Node/ReferenceTest.php @@ -4,7 +4,7 @@ namespace Tests\Innmind\ObjectGraph\Node; use Innmind\ObjectGraph\Node\Reference; -use PHPUnit\Framework\TestCase; +use Innmind\BlackBox\PHPUnit\Framework\TestCase; class ReferenceTest extends TestCase { diff --git a/tests/NodeTest.php b/tests/NodeTest.php index d53fa1d..f7223d3 100644 --- a/tests/NodeTest.php +++ b/tests/NodeTest.php @@ -10,7 +10,7 @@ Relation\Property, }; use Innmind\Immutable\Set; -use PHPUnit\Framework\TestCase; +use Innmind\BlackBox\PHPUnit\Framework\TestCase; class NodeTest extends TestCase { diff --git a/tests/Relation/PropertyTest.php b/tests/Relation/PropertyTest.php index d342c1c..25ceeae 100644 --- a/tests/Relation/PropertyTest.php +++ b/tests/Relation/PropertyTest.php @@ -4,7 +4,7 @@ namespace Tests\Innmind\ObjectGraph\Relation; use Innmind\ObjectGraph\Relation\Property; -use PHPUnit\Framework\TestCase; +use Innmind\BlackBox\PHPUnit\Framework\TestCase; class PropertyTest extends TestCase { diff --git a/tests/RenderTest.php b/tests/RenderTest.php index 0131a54..060a0e3 100644 --- a/tests/RenderTest.php +++ b/tests/RenderTest.php @@ -10,7 +10,7 @@ }; use Innmind\Filesystem\File\Content; use Fixtures\Innmind\ObjectGraph\Foo; -use PHPUnit\Framework\TestCase; +use Innmind\BlackBox\PHPUnit\Framework\TestCase; class RenderTest extends TestCase { @@ -34,7 +34,7 @@ public function testInvokation() $dot = Render::of()($graph); $this->assertInstanceOf(Content::class, $dot); - $this->assertNotEmpty($dot->toString()); + $this->assertNotSame('', $dot->toString()); $lines = $dot ->lines() ->map(static fn($line) => $line->str()->trim()->toString()) @@ -81,7 +81,7 @@ public function testRenderRecursiveGraph() $dot = Render::of()(Lookup::of()($a)); $this->assertInstanceOf(Content::class, $dot); - $this->assertNotEmpty($dot->toString()); + $this->assertNotSame('', $dot->toString()); $lines = $dot ->lines() ->map(static fn($line) => $line->str()->trim()->toString()) @@ -109,7 +109,7 @@ public function testRenderFromTopToBottom() $dot = Render::of()->fromTopToBottom()($graph); $this->assertInstanceOf(Content::class, $dot); - $this->assertNotEmpty($dot->toString()); + $this->assertNotSame('', $dot->toString()); $lines = $dot ->lines() ->map(static fn($line) => $line->str()->trim()->toString()) diff --git a/tests/RewriteLocation/SublimeHandlerTest.php b/tests/RewriteLocation/SublimeHandlerTest.php index 46e84ad..e60d596 100644 --- a/tests/RewriteLocation/SublimeHandlerTest.php +++ b/tests/RewriteLocation/SublimeHandlerTest.php @@ -8,7 +8,7 @@ RewriteLocation, }; use Innmind\Url\Url; -use PHPUnit\Framework\TestCase; +use Innmind\BlackBox\PHPUnit\Framework\TestCase; class SublimeHandlerTest extends TestCase {