Skip to content

Commit 45aefc5

Browse files
committed
replace phpunit by blackbox
1 parent b461204 commit 45aefc5

9 files changed

Lines changed: 35 additions & 25 deletions

File tree

.github/workflows/ci.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@ jobs:
2626
with:
2727
dependency-versions: ${{ matrix.dependencies }}
2828
- name: PHPUnit
29-
run: vendor/bin/phpunit --coverage-clover=coverage.clover
29+
run: php blackbox.php
30+
env:
31+
ENABLE_COVERAGE: 'true'
3032
- uses: codecov/codecov-action@v1
3133
with:
3234
token: ${{ secrets.CODECOV_TOKEN }}

.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

blackbox.php

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
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+
->when(
14+
\getenv('ENABLE_COVERAGE') !== false,
15+
static fn(Application $app) => $app
16+
->codeCoverage(
17+
CodeCoverage::of(
18+
__DIR__.'/src/',
19+
__DIR__.'/tests/',
20+
)
21+
->dumpTo('coverage.clover')
22+
->enableWhen(true),
23+
)
24+
->scenariiPerProof(1),
25+
)
26+
->tryToProve(Load::directory(__DIR__.'/tests/'))
27+
->exit();

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@
3131
}
3232
},
3333
"require-dev": {
34-
"phpunit/phpunit": "~9.0",
3534
"vimeo/psalm": "~5.6",
35+
"innmind/black-box": "~6.5",
3636
"innmind/coding-standard": "~2.0"
3737
}
3838
}

phpunit.xml.dist

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

tests/ViaAuthorizationTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
};
1717
use Innmind\Url\Url;
1818
use Innmind\Immutable\Attempt;
19-
use PHPUnit\Framework\TestCase;
19+
use Innmind\BlackBox\PHPUnit\Framework\TestCase;
2020

2121
class ViaAuthorizationTest extends TestCase
2222
{

tests/ViaBasicAuthorizationTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
};
1616
use Innmind\Url\Url;
1717
use Innmind\Immutable\Attempt;
18-
use PHPUnit\Framework\TestCase;
18+
use Innmind\BlackBox\PHPUnit\Framework\TestCase;
1919

2020
class ViaBasicAuthorizationTest extends TestCase
2121
{

tests/ViaFormTest.php

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

1616
class ViaFormTest extends TestCase
1717
{

tests/ViaUrlAuthorityTest.php

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

1616
class ViaUrlAuthorityTest extends TestCase
1717
{

0 commit comments

Comments
 (0)