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,4 +1,3 @@
/.gitattributes export-ignore
/.gitignore export-ignore
/phpunit.xml.dist 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]

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@v2"
with:
dependency-versions: ${{ matrix.dependencies }}
- name: PHPUnit
run: vendor/bin/phpunit --coverage-clover=coverage.clover
- uses: codecov/codecov-action@v3
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,
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 @@ -30,7 +30,6 @@
}
},
"require-dev": {
"phpunit/phpunit": "~10.2",
"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.

2 changes: 1 addition & 1 deletion src/Agent/WatchFixtures.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public function __invoke(
return null;
}

$filesystem->watch($fixtures)(
$_ = $filesystem->watch($fixtures)(
$activities,
static fn(Activities $activities, $continuation) => $continuation->continue(
$activities->push(Activity::fixturesModified),
Expand Down
2 changes: 1 addition & 1 deletion src/Agent/WatchProofs.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public function __invoke(
return null;
}

$filesystem->watch($proofs)(
$_ = $filesystem->watch($proofs)(
$activities,
static fn(Activities $activities, $continuation) => $continuation->continue(
$activities->push(Activity::proofsModified),
Expand Down
2 changes: 1 addition & 1 deletion src/Agent/WatchProperties.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public function __invoke(
return null;
}

$filesystem->watch($properties)(
$_ = $filesystem->watch($properties)(
$activities,
static fn(Activities $activities, $continuation) => $continuation->continue(
$activities->push(Activity::propertiesModified),
Expand Down
2 changes: 1 addition & 1 deletion src/Agent/WatchSources.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public function __invoke(
): ?Agent {
$src = $project->resolve(Path::of('src/'));

$os->filesystem()->watch($src)(
$_ = $os->filesystem()->watch($src)(
$activities,
static fn(Activities $activities, $continuation) => $continuation->continue(
$activities->push(Activity::sourcesModified),
Expand Down
2 changes: 1 addition & 1 deletion src/Agent/WatchTests.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public function __invoke(
return null;
}

$filesystem->watch($tests)(
$_ = $filesystem->watch($tests)(
$activities,
static fn(Activities $activities, $continuation) => $continuation->continue(
$activities->push(Activity::testsModified),
Expand Down
11 changes: 8 additions & 3 deletions tests/Agent/WatchFixturesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
Server,
Server\Process\Builder,
};
use Innmind\Time\Halt;
use Innmind\Filesystem\{
Adapter,
Directory,
Expand All @@ -28,8 +29,9 @@
use Innmind\Immutable\{
Set,
Attempt,
SideEffect,
};
use PHPUnit\Framework\TestCase;
use Innmind\BlackBox\PHPUnit\Framework\TestCase;

class WatchFixturesTest extends TestCase
{
Expand Down Expand Up @@ -66,11 +68,14 @@ static function($command) use (&$count) {

return Attempt::result($builder->build());
},
))
->haltProcessVia(Halt::via(
static fn() => Attempt::result(SideEffect::identity),
)),
);

$activities = Activities::new(
$this->createMock(Trigger::class),
new Trigger\All,
new Iteration,
Set::of(...Triggers::cases()),
);
Expand All @@ -92,7 +97,7 @@ public function testDoesntWatchWhenTheFolderDoesntExist()

$os = OperatingSystem::new();
$activities = Activities::new(
$this->createMock(Trigger::class),
new Trigger\All,
new Iteration,
Set::of(...Triggers::cases()),
);
Expand Down
11 changes: 8 additions & 3 deletions tests/Agent/WatchProofsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
Server,
Server\Process\Builder,
};
use Innmind\Time\Halt;
use Innmind\Filesystem\{
Adapter,
Directory,
Expand All @@ -28,8 +29,9 @@
use Innmind\Immutable\{
Set,
Attempt,
SideEffect,
};
use PHPUnit\Framework\TestCase;
use Innmind\BlackBox\PHPUnit\Framework\TestCase;

class WatchProofsTest extends TestCase
{
Expand Down Expand Up @@ -66,11 +68,14 @@ static function($command) use (&$count) {

return Attempt::result($builder->build());
},
))
->haltProcessVia(Halt::via(
static fn() => Attempt::result(SideEffect::identity),
)),
);

$activities = Activities::new(
$this->createMock(Trigger::class),
new Trigger\All,
new Iteration,
Set::of(...Triggers::cases()),
);
Expand All @@ -92,7 +97,7 @@ public function testDoesntWatchWhenTheFolderDoesntExist()

$os = OperatingSystem::new();
$activities = Activities::new(
$this->createMock(Trigger::class),
new Trigger\All,
new Iteration,
Set::of(...Triggers::cases()),
);
Expand Down
11 changes: 8 additions & 3 deletions tests/Agent/WatchPropertiesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
Server,
Server\Process\Builder,
};
use Innmind\Time\Halt;
use Innmind\Filesystem\{
Adapter,
Directory,
Expand All @@ -28,8 +29,9 @@
use Innmind\Immutable\{
Set,
Attempt,
SideEffect,
};
use PHPUnit\Framework\TestCase;
use Innmind\BlackBox\PHPUnit\Framework\TestCase;

class WatchPropertiesTest extends TestCase
{
Expand Down Expand Up @@ -66,11 +68,14 @@ static function($command) use (&$count) {

return Attempt::result($builder->build());
},
))
->haltProcessVia(Halt::via(
static fn() => Attempt::result(SideEffect::identity),
)),
);

$activities = Activities::new(
$this->createMock(Trigger::class),
new Trigger\All,
new Iteration,
Set::of(...Triggers::cases()),
);
Expand All @@ -92,7 +97,7 @@ public function testDoesntWatchWhenTheFolderDoesntExist()

$os = OperatingSystem::new();
$activities = Activities::new(
$this->createMock(Trigger::class),
new Trigger\All,
new Iteration,
Set::of(...Triggers::cases()),
);
Expand Down
9 changes: 7 additions & 2 deletions tests/Agent/WatchSourcesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
Server,
Server\Process\Builder,
};
use Innmind\Time\Halt;
use Innmind\Filesystem\{
Adapter,
Directory,
Expand All @@ -28,8 +29,9 @@
use Innmind\Immutable\{
Set,
Attempt,
SideEffect,
};
use PHPUnit\Framework\TestCase;
use Innmind\BlackBox\PHPUnit\Framework\TestCase;

class WatchSourcesTest extends TestCase
{
Expand Down Expand Up @@ -66,11 +68,14 @@ static function($command) use (&$count) {

return Attempt::result($builder->build());
},
))
->haltProcessVia(Halt::via(
static fn() => Attempt::result(SideEffect::identity),
)),
);

$activities = Activities::new(
$this->createMock(Trigger::class),
new Trigger\All,
new Iteration,
Set::of(...Triggers::cases()),
);
Expand Down
11 changes: 8 additions & 3 deletions tests/Agent/WatchTestsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
Server,
Server\Process\Builder,
};
use Innmind\Time\Halt;
use Innmind\Filesystem\{
Adapter,
Directory,
Expand All @@ -28,8 +29,9 @@
use Innmind\Immutable\{
Set,
Attempt,
SideEffect,
};
use PHPUnit\Framework\TestCase;
use Innmind\BlackBox\PHPUnit\Framework\TestCase;

class WatchTestsTest extends TestCase
{
Expand Down Expand Up @@ -66,11 +68,14 @@ static function($command) use (&$count) {

return Attempt::result($builder->build());
},
))
->haltProcessVia(Halt::via(
static fn() => Attempt::result(SideEffect::identity),
)),
);

$activities = Activities::new(
$this->createMock(Trigger::class),
new Trigger\All,
new Iteration,
Set::of(...Triggers::cases()),
);
Expand All @@ -92,7 +97,7 @@ public function testDoesntWatchWhenTheFolderDoesntExist()

$os = OperatingSystem::new();
$activities = Activities::new(
$this->createMock(Trigger::class),
new Trigger\All,
new Iteration,
Set::of(...Triggers::cases()),
);
Expand Down
2 changes: 1 addition & 1 deletion tests/BootstrapTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
use function Innmind\LabStation\bootstrap;
use Innmind\OperatingSystem\OperatingSystem;
use Innmind\CLI\Commands;
use PHPUnit\Framework\TestCase;
use Innmind\BlackBox\PHPUnit\Framework\TestCase;

class BootstrapTest extends TestCase
{
Expand Down
6 changes: 3 additions & 3 deletions tests/Command/WorkTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
};
use Innmind\CLI\Command;
use Innmind\OperatingSystem\OperatingSystem;
use PHPUnit\Framework\TestCase;
use Innmind\BlackBox\PHPUnit\Framework\TestCase;

class WorkTest extends TestCase
{
Expand All @@ -23,7 +23,7 @@ public function testInterface()
new Monitor(
OperatingSystem::new(),
new Iteration,
$this->createMock(Trigger::class),
new Trigger\All,
),
),
);
Expand All @@ -43,7 +43,7 @@ public function testUsage()
new Monitor(
OperatingSystem::new(),
new Iteration,
$this->createMock(Trigger::class),
new Trigger\All,
),
))->usage()->toString(),
);
Expand Down
Loading