-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* develop: specify next release fix tests CS use blackbox 5
- Loading branch information
Showing
58 changed files
with
1,101 additions
and
895 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?php | ||
declare(strict_types = 1); | ||
|
||
require 'vendor/autoload.php'; | ||
|
||
use Innmind\BlackBox\{ | ||
Application, | ||
Runner\Load, | ||
Runner\CodeCoverage, | ||
}; | ||
|
||
// because the generated trees can be quite large | ||
\ini_set('memory_limit', '-1'); | ||
|
||
Application::new($argv) | ||
->codeCoverage( | ||
CodeCoverage::of( | ||
__DIR__.'/src/', | ||
__DIR__.'/proofs/', | ||
__DIR__.'/fixtures/', | ||
) | ||
->dumpTo('coverage.clover') | ||
->enableWhen(\getenv('ENABLE_COVERAGE') !== false), | ||
) | ||
->scenariiPerProof(match (\getenv('ENABLE_COVERAGE')) { | ||
false => 20, | ||
default => 1, | ||
}) | ||
->tryToProve(Load::everythingIn(__DIR__.'/proofs/')) | ||
->exit(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,26 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" colors="true" bootstrap="vendor/autoload.php" printerClass="Innmind\BlackBox\PHPUnit\ResultPrinterV9" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"> | ||
<coverage> | ||
<include> | ||
<directory>.</directory> | ||
</include> | ||
<exclude> | ||
<directory>./tests</directory> | ||
<directory>./vendor</directory> | ||
</exclude> | ||
</coverage> | ||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" colors="true" bootstrap="vendor/autoload.php" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.2/phpunit.xsd"> | ||
<extensions> | ||
<bootstrap class="Innmind\BlackBox\PHPUnit\Extension"> | ||
</bootstrap> | ||
</extensions> | ||
<coverage/> | ||
<php> | ||
<env name="BLACKBOX_SET_SIZE" value="1"/> | ||
<ini name="memory_limit" value="-1" /> | ||
<ini name="memory_limit" value="-1"/> | ||
</php> | ||
<testsuites> | ||
<testsuite name="Filesystem test suite"> | ||
<directory>./tests</directory> | ||
</testsuite> | ||
</testsuites> | ||
<source> | ||
<include> | ||
<directory>.</directory> | ||
</include> | ||
<exclude> | ||
<directory>./tests</directory> | ||
<directory>./vendor</directory> | ||
</exclude> | ||
</source> | ||
</phpunit> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
use Innmind\Filesystem\{ | ||
Adapter\Filesystem, | ||
Directory\Directory, | ||
File\File, | ||
File\Content\None, | ||
CaseSensitivity, | ||
}; | ||
use Innmind\Url\Path; | ||
use Properties\Innmind\Filesystem\Adapter; | ||
use Innmind\BlackBox\Set; | ||
use Symfony\Component\Filesystem\Filesystem as FS; | ||
|
||
return static function() { | ||
yield proof( | ||
'Filesystem properties', | ||
given(Adapter::properties()), | ||
function($assert, $properties) { | ||
$path = \sys_get_temp_dir().'/innmind/filesystem/'; | ||
(new FS)->remove($path); | ||
|
||
$properties->ensureHeldBy($assert, Filesystem::mount(Path::of($path))); | ||
|
||
(new FS)->remove($path); | ||
}, | ||
); | ||
|
||
foreach (Adapter::list() as $property) { | ||
yield proof( | ||
'Filesystem property', | ||
given($property), | ||
function($assert, $property) { | ||
$path = \sys_get_temp_dir().'/innmind/filesystem/'; | ||
(new FS)->remove($path); | ||
$filesystem = Filesystem::mount(Path::of($path)); | ||
|
||
if ($property->applicableTo($filesystem)) { | ||
$property->ensureHeldBy($assert, $filesystem); | ||
} | ||
|
||
(new FS)->remove($path); | ||
}, | ||
); | ||
} | ||
|
||
yield test( | ||
'Regression adding file in directory due to case sensitivity', | ||
function($assert) { | ||
$property = new Adapter\AddRemoveAddModificationsStillAddTheFile( | ||
Directory::named('0') | ||
->add($file = File::named('L', None::of())) | ||
->remove($file->name()), | ||
File::named('l', None::of()), | ||
); | ||
|
||
$path = \sys_get_temp_dir().'/innmind/filesystem/'; | ||
(new FS)->remove($path); | ||
$adapter = Filesystem::mount(Path::of($path))->withCaseSensitivity(match (\PHP_OS) { | ||
'Darwin' => CaseSensitivity::insensitive, | ||
default => CaseSensitivity::sensitive, | ||
}); | ||
|
||
$property->ensureHeldBy($assert, $adapter); | ||
|
||
(new FS)->remove($path); | ||
} | ||
); | ||
}; |
Oops, something went wrong.