Skip to content

Commit

Permalink
run tests via blackbox
Browse files Browse the repository at this point in the history
  • Loading branch information
Baptouuuu committed Nov 26, 2023
1 parent 97ce4a4 commit 9190b52
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 38 deletions.
1 change: 0 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/.gitattributes export-ignore
/.gitignore export-ignore
/phpunit.xml.dist export-ignore
/tests export-ignore
14 changes: 7 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ name: CI
on: [push]

jobs:
phpunit:
blackbox:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macOS-latest]
php-version: ['8.2', '8.3']
dependencies: ['lowest', 'highest']
name: 'PHPUnit'
name: 'BlackBox'
steps:
- name: Checkout
uses: actions/checkout@v2
Expand All @@ -24,8 +24,8 @@ jobs:
uses: "ramsey/composer-install@v2"
with:
dependency-versions: ${{ matrix.dependencies }}
- name: PHPUnit
run: vendor/bin/phpunit
- name: BlackBox
run: php blackbox.php
coverage:
runs-on: ${{ matrix.os }}
strategy:
Expand All @@ -47,10 +47,10 @@ jobs:
uses: "ramsey/composer-install@v2"
with:
dependency-versions: ${{ matrix.dependencies }}
- name: PHPUnit
run: vendor/bin/phpunit --coverage-clover=coverage.clover
- name: BlackBox
run: php blackbox.php
env:
BLACKBOX_SET_SIZE: 1
ENABLE_COVERAGE: 'true'
- uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
Expand Down
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
composer.lock
vendor
.phpunit.result.cache
.phpunit.cache
27 changes: 27 additions & 0 deletions blackbox.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php
declare(strict_types = 1);

require 'vendor/autoload.php';

use Innmind\BlackBox\{
Application,
PHPUnit\Load,
Runner\CodeCoverage,
};

Application::new($argv)
->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();
1 change: 0 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
}
},
"require-dev": {
"phpunit/phpunit": "~10.2",
"vimeo/psalm": "~5.6",
"innmind/black-box": "~5.5",
"innmind/coding-standard": "~2.0",
Expand Down
25 changes: 0 additions & 25 deletions phpunit.xml.dist

This file was deleted.

2 changes: 1 addition & 1 deletion tests/ApplicationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@
Map,
Str,
};
use PHPUnit\Framework\TestCase;
use Innmind\BlackBox\{
PHPUnit\BlackBox,
Set,
PHPUnit\Framework\TestCase,
};
use Fixtures\Innmind\Url\Url as FUrl;

Expand Down
2 changes: 1 addition & 1 deletion tests/FunctionalTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
ProtocolVersion,
};
use Innmind\Url\Url;
use PHPUnit\Framework\TestCase;
use Innmind\BlackBox\PHPUnit\Framework\TestCase;

class FunctionalTest extends TestCase
{
Expand Down

0 comments on commit 9190b52

Please sign in to comment.