Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/.gitattributes export-ignore
/.gitignore export-ignore
/phpunit.xml.dist export-ignore
/fixtures export-ignore
/tests export-ignore
32 changes: 5 additions & 27 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,33 +3,11 @@ name: CI
on: [push, pull_request]

jobs:
phpunit:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macOS-latest]
php-version: ['8.4', '8.5']
dependencies: ['lowest', 'highest']
name: 'PHPUnit'
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
extensions: mbstring, intl
coverage: xdebug
ini-values: xdebug.max_nesting_level=2048
- name: Composer
uses: "ramsey/composer-install@v3"
with:
dependency-versions: ${{ matrix.dependencies }}
- name: PHPUnit
run: vendor/bin/phpunit --coverage-clover=coverage.clover
- uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
blackbox:
uses: innmind/github-workflows/.github/workflows/black-box-matrix.yml@main
coverage:
uses: innmind/github-workflows/.github/workflows/coverage-matrix.yml@main
secrets: inherit
psalm:
uses: innmind/github-workflows/.github/workflows/psalm-matrix.yml@main
cs:
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,
Runner\CodeCoverage,
PHPUnit\Load,
};

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 @@ -32,7 +32,6 @@
}
},
"require-dev": {
"phpunit/phpunit": "~12.0",
"innmind/static-analysis": "~1.3",
"innmind/black-box": "~6.5",
"innmind/coding-standard": "~2.0"
Expand Down
22 changes: 0 additions & 22 deletions phpunit.xml.dist

This file was deleted.

20 changes: 10 additions & 10 deletions tests/Command/CheckDotInstalledTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,21 @@
Str,
Attempt,
};
use PHPUnit\Framework\TestCase;
use Innmind\BlackBox\{
PHPUnit\BlackBox,
PHPUnit\Framework\TestCase,
Set,
};

class CheckDotInstalledTest extends TestCase
{
use BlackBox;

public function testCallCommandIfInstalled()
public function testCallCommandIfInstalled(): BlackBox\Proof
{
$this
return $this
->forAll(Set::of('some', 'command', 'name'))
->then(function($usage) {
->prove(function($usage) {
$inner = new class($usage) implements Command {
public function __construct(private string $usage)
{
Expand Down Expand Up @@ -85,11 +85,11 @@ function($command) {
});
}

public function testReturnErrorWhenNotInstalled()
public function testReturnErrorWhenNotInstalled(): BlackBox\Proof
{
$this
return $this
->forAll(Set::of('some', 'command', 'name'))
->then(function($usage) {
->prove(function($usage) {
$inner = new class($usage) implements Command {
public function __construct(private string $usage)
{
Expand Down Expand Up @@ -149,11 +149,11 @@ function($command) {
});
}

public function testUsage()
public function testUsage(): BlackBox\Proof
{
$this
return $this
->forAll(Set::of('some', 'command', 'name'))
->then(function($usage) {
->prove(function($usage) {
$inner = new class($usage) implements Command {
public function __construct(private string $usage)
{
Expand Down
2 changes: 1 addition & 1 deletion tests/Command/DependsOnTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
Map,
Attempt,
};
use PHPUnit\Framework\TestCase;
use Innmind\BlackBox\PHPUnit\Framework\TestCase;

class DependsOnTest extends TestCase
{
Expand Down
2 changes: 1 addition & 1 deletion tests/Command/FromLockTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
Attempt,
Map,
};
use PHPUnit\Framework\TestCase;
use Innmind\BlackBox\PHPUnit\Framework\TestCase;

class FromLockTest extends TestCase
{
Expand Down
2 changes: 1 addition & 1 deletion tests/Command/OfTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
Map,
Attempt,
};
use PHPUnit\Framework\TestCase;
use Innmind\BlackBox\PHPUnit\Framework\TestCase;

class OfTest extends TestCase
{
Expand Down
2 changes: 1 addition & 1 deletion tests/Command/VendorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
Map,
Attempt,
};
use PHPUnit\Framework\TestCase;
use Innmind\BlackBox\PHPUnit\Framework\TestCase;

class VendorTest extends TestCase
{
Expand Down
2 changes: 1 addition & 1 deletion tests/Loader/ComposerLockTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
use Innmind\OperatingSystem\Factory;
use Innmind\Url\Path;
use Innmind\Immutable\Set;
use PHPUnit\Framework\TestCase;
use Innmind\BlackBox\PHPUnit\Framework\TestCase;

class ComposerLockTest extends TestCase
{
Expand Down
2 changes: 1 addition & 1 deletion tests/Loader/DependenciesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
use Innmind\HttpTransport\Transport;
use Innmind\Time\Clock;
use Innmind\Immutable\Set;
use PHPUnit\Framework\TestCase;
use Innmind\BlackBox\PHPUnit\Framework\TestCase;

class DependenciesTest extends TestCase
{
Expand Down
2 changes: 1 addition & 1 deletion tests/Loader/Dependents/GraphTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
};
use Innmind\Url\Url;
use Innmind\Immutable\Set;
use PHPUnit\Framework\TestCase;
use Innmind\BlackBox\PHPUnit\Framework\TestCase;

class GraphTest extends TestCase
{
Expand Down
2 changes: 1 addition & 1 deletion tests/Loader/DependentsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
use Innmind\HttpTransport\Transport;
use Innmind\Time\Clock;
use Innmind\Immutable\Set;
use PHPUnit\Framework\TestCase;
use Innmind\BlackBox\PHPUnit\Framework\TestCase;

class DependentsTest extends TestCase
{
Expand Down
2 changes: 1 addition & 1 deletion tests/Loader/PackageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
};
use Innmind\HttpTransport\Transport;
use Innmind\Time\Clock;
use PHPUnit\Framework\TestCase;
use Innmind\BlackBox\PHPUnit\Framework\TestCase;

class PackageTest extends TestCase
{
Expand Down
2 changes: 1 addition & 1 deletion tests/Loader/VendorDependenciesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
use Innmind\HttpTransport\Transport;
use Innmind\Time\Clock;
use Innmind\Immutable\Set;
use PHPUnit\Framework\TestCase;
use Innmind\BlackBox\PHPUnit\Framework\TestCase;

class VendorDependenciesTest extends TestCase
{
Expand Down
2 changes: 1 addition & 1 deletion tests/Loader/VendorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
};
use Innmind\HttpTransport\Transport;
use Innmind\Time\Clock;
use PHPUnit\Framework\TestCase;
use Innmind\BlackBox\PHPUnit\Framework\TestCase;

class VendorTest extends TestCase
{
Expand Down
8 changes: 4 additions & 4 deletions tests/Package/ConstraintTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,21 @@
Package\Version,
Exception\DomainException,
};
use PHPUnit\Framework\TestCase;
use Innmind\BlackBox\{
PHPUnit\BlackBox,
PHPUnit\Framework\TestCase,
Set,
};

class ConstraintTest extends TestCase
{
use BlackBox;

public function testInterface()
public function testInterface(): BlackBox\Proof
{
$this
return $this
->forAll(Set\Strings::any()->filter(static fn($string) => $string !== ''))
->then(function(string $string): void {
->prove(function(string $string): void {
$this->assertSame($string, (new Constraint($string))->toString());
});
}
Expand Down
2 changes: 1 addition & 1 deletion tests/Package/NameTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
Package\Name,
Exception\DomainException,
};
use PHPUnit\Framework\TestCase;
use Innmind\BlackBox\PHPUnit\Framework\TestCase;

class NameTest extends TestCase
{
Expand Down
2 changes: 1 addition & 1 deletion tests/Package/RelationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
Package\Constraint,
Package\Name,
};
use PHPUnit\Framework\TestCase;
use Innmind\BlackBox\PHPUnit\Framework\TestCase;

class RelationTest extends TestCase
{
Expand Down
8 changes: 4 additions & 4 deletions tests/Package/VersionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,21 @@
Package\Version,
Exception\DomainException,
};
use PHPUnit\Framework\TestCase;
use Innmind\BlackBox\{
PHPUnit\BlackBox,
PHPUnit\Framework\TestCase,
Set,
};

class VersionTest extends TestCase
{
use BlackBox;

public function testInterface()
public function testInterface(): BlackBox\Proof
{
$this
return $this
->forAll(Set\Strings::any()->filter(static fn($string) => $string !== ''))
->then(function(string $string): void {
->prove(function(string $string): void {
$this->assertSame($string, Version::of($string)->toString());
});
}
Expand Down
2 changes: 1 addition & 1 deletion tests/PackageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
};
use Innmind\Url\Url;
use Innmind\Immutable\Set;
use PHPUnit\Framework\TestCase;
use Innmind\BlackBox\PHPUnit\Framework\TestCase;

class PackageTest extends TestCase
{
Expand Down
2 changes: 1 addition & 1 deletion tests/RenderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
Path,
Scheme,
};
use PHPUnit\Framework\TestCase;
use Innmind\BlackBox\PHPUnit\Framework\TestCase;

class RenderTest extends TestCase
{
Expand Down
2 changes: 1 addition & 1 deletion tests/Vendor/NameTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
Vendor\Name,
Exception\DomainException,
};
use PHPUnit\Framework\TestCase;
use Innmind\BlackBox\PHPUnit\Framework\TestCase;

class NameTest extends TestCase
{
Expand Down
2 changes: 1 addition & 1 deletion tests/VendorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
};
use Innmind\Url\Url;
use Innmind\Immutable\Set;
use PHPUnit\Framework\TestCase;
use Innmind\BlackBox\PHPUnit\Framework\TestCase;

class VendorTest extends TestCase
{
Expand Down
Loading