Skip to content

Commit 029bd6a

Browse files
committed
Fixing the PHPUnit tests
1 parent ed66699 commit 029bd6a

File tree

4 files changed

+92
-2
lines changed

4 files changed

+92
-2
lines changed

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@
2626
"adlawson/vfs": "^0.12.1",
2727
"phpstan/phpstan": "^0.12.93",
2828
"php-etl/sql-flow": "^0.1.0",
29-
"friendsofphp/php-cs-fixer": "^3.0"
29+
"friendsofphp/php-cs-fixer": "^3.0",
30+
"mikey179/vfsstream": "^1.6"
3031
},
3132
"autoload": {
3233
"psr-4": {

composer.lock

Lines changed: 52 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/functional/Builder/ExtractorTest.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
use Kiboko\Component\PHPUnitExtension\Assert;
66
use Kiboko\Contract\Pipeline\PipelineRunnerInterface;
77
use Kiboko\Plugin\SQL\Factory\Extractor;
8+
use org\bovigo\vfs\vfsStream;
9+
use org\bovigo\vfs\vfsStreamDirectory;
810
use PHPUnit\Framework\TestCase;
911
use Symfony\Component\ExpressionLanguage\Expression;
1012
use Symfony\Component\ExpressionLanguage\ExpressionLanguage;
@@ -14,6 +16,23 @@ final class ExtractorTest extends TestCase
1416
use Assert\PipelineBuilderAssertTrait;
1517
use Assert\ExtractorBuilderAssertTrait;
1618

19+
private ?vfsStreamDirectory $fs = null;
20+
21+
protected function setUp(): void
22+
{
23+
$this->fs = vfsStream::setup();
24+
}
25+
26+
protected function tearDown(): void
27+
{
28+
$this->fs = null;
29+
}
30+
31+
protected function getBuilderCompilePath(): string
32+
{
33+
return $this->fs->url();
34+
}
35+
1736
public function testValidatingConfiguration(): void
1837
{
1938
$extractor = new Extractor(new ExpressionLanguage());

tests/functional/Builder/LoaderTest.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
use Kiboko\Component\PHPUnitExtension\Assert;
66
use Kiboko\Contract\Pipeline\PipelineRunnerInterface;
77
use Kiboko\Plugin\SQL\Factory\Loader;
8+
use org\bovigo\vfs\vfsStream;
9+
use org\bovigo\vfs\vfsStreamDirectory;
810
use PHPUnit\Framework\TestCase;
911
use Symfony\Component\ExpressionLanguage\Expression;
1012
use Symfony\Component\ExpressionLanguage\ExpressionLanguage;
@@ -14,6 +16,23 @@ final class LoaderTest extends TestCase
1416
use Assert\PipelineBuilderAssertTrait;
1517
use Assert\ExtractorBuilderAssertTrait;
1618

19+
private ?vfsStreamDirectory $fs = null;
20+
21+
protected function setUp(): void
22+
{
23+
$this->fs = vfsStream::setup();
24+
}
25+
26+
protected function tearDown(): void
27+
{
28+
$this->fs = null;
29+
}
30+
31+
protected function getBuilderCompilePath(): string
32+
{
33+
return $this->fs->url();
34+
}
35+
1736
public function testValidatingConfiguration(): void
1837
{
1938
$extractor = new Loader(new ExpressionLanguage());

0 commit comments

Comments
 (0)