Skip to content

Commit 591c0e9

Browse files
authored
Merge pull request #10 from Innmind/use-blackbox
Replace PHPUnit by BlackBox
2 parents 10c61de + 13e4721 commit 591c0e9

15 files changed

Lines changed: 50 additions & 35 deletions

.gitattributes

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
/.gitattributes export-ignore
22
/.gitignore export-ignore
3-
/phpunit.xml.dist export-ignore
43
/fixtures export-ignore
54
/tests export-ignore

.github/workflows/ci.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
strategy:
99
matrix:
1010
os: [ubuntu-latest, macOS-latest]
11-
php-version: ['8.1', '8.2', '8.3']
11+
php-version: ['8.2', '8.3']
1212
name: 'PHPUnit'
1313
steps:
1414
- name: Checkout
@@ -22,15 +22,17 @@ jobs:
2222
- name: Composer
2323
uses: "ramsey/composer-install@v2"
2424
- name: PHPUnit
25-
run: vendor/bin/phpunit --coverage-clover=coverage.clover
25+
run: php blackbox.php
26+
env:
27+
ENABLE_COVERAGE: 'true'
2628
- uses: codecov/codecov-action@v1
2729
with:
2830
token: ${{ secrets.CODECOV_TOKEN }}
2931
psalm:
3032
runs-on: ubuntu-latest
3133
strategy:
3234
matrix:
33-
php-version: ['8.1', '8.2', '8.3']
35+
php-version: ['8.2', '8.3']
3436
name: 'Psalm'
3537
steps:
3638
- name: Checkout
@@ -48,7 +50,7 @@ jobs:
4850
runs-on: ubuntu-latest
4951
strategy:
5052
matrix:
51-
php-version: ['8.1']
53+
php-version: ['8.2']
5254
name: 'CS'
5355
steps:
5456
- name: Checkout

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
/composer.lock
22
/vendor
3-
/.phpunit.result.cache

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
## [Unreleased]
44

5+
### Changed
6+
7+
- Requires PHP `~8.2`
8+
59
### Fixed
610

711
- PHP `8.4` deprecations

blackbox.php

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?php
2+
declare(strict_types = 1);
3+
4+
require 'vendor/autoload.php';
5+
6+
use Innmind\BlackBox\{
7+
Application,
8+
PHPUnit\Load,
9+
Runner\CodeCoverage,
10+
};
11+
12+
Application::new($argv)
13+
->disableMemoryLimit()
14+
->when(
15+
\getenv('ENABLE_COVERAGE') !== false,
16+
static fn(Application $app) => $app
17+
->codeCoverage(
18+
CodeCoverage::of(
19+
__DIR__.'/src/',
20+
__DIR__.'/tests/',
21+
)
22+
->dumpTo('coverage.clover')
23+
->enableWhen(true),
24+
)
25+
->scenariiPerProof(1),
26+
)
27+
->tryToProve(Load::directory(__DIR__.'/tests/'))
28+
->exit();

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
}
3434
},
3535
"require-dev": {
36-
"phpunit/phpunit": "~9.0",
36+
"innmind/black-box": "^6.4.1",
3737
"vimeo/psalm": "~5.6",
3838
"innmind/coding-standard": "~2.0"
3939
}

phpunit.xml.dist

Lines changed: 0 additions & 17 deletions
This file was deleted.

tests/GraphTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
Relation\Property,
1212
};
1313
use Innmind\Immutable\Set;
14-
use PHPUnit\Framework\TestCase;
14+
use Innmind\BlackBox\PHPUnit\Framework\TestCase;
1515

1616
class GraphTest extends TestCase
1717
{

tests/LookupTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
use Innmind\ObjectGraph\Lookup;
77
use Fixtures\Innmind\ObjectGraph\Foo;
8-
use PHPUnit\Framework\TestCase;
8+
use Innmind\BlackBox\PHPUnit\Framework\TestCase;
99

1010
class LookupTest extends TestCase
1111
{

tests/Node/ClassNameTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
namespace Tests\Innmind\ObjectGraph\Node;
55

66
use Innmind\ObjectGraph\Node\ClassName;
7-
use PHPUnit\Framework\TestCase;
7+
use Innmind\BlackBox\PHPUnit\Framework\TestCase;
88

99
class ClassNameTest extends TestCase
1010
{

0 commit comments

Comments
 (0)