Support other OS on tests (#1715)

This commit is contained in:
erikn69
2025-07-17 07:52:32 +02:00
committed by GitHub
parent cff244b9b5
commit 6d96f0bd1a
7 changed files with 33 additions and 60 deletions
+6
View File
@@ -55,6 +55,11 @@ abstract class TestCase extends BaseTestCase
$this->assertMatchesSnapshot($actualContent, new SnapshotTxtDriver());
}
protected function assertMatchesMockedSnapshot()
{
$this->assertMatchesSnapshot($this->mockFilesystemOutput, new SnapshotPhpDriver());
}
protected function mockFilesystem()
{
$mockFilesystem = Mockery::mock(Filesystem::class)->makePartial();
@@ -66,6 +71,7 @@ abstract class TestCase extends BaseTestCase
Mockery::any()
)
->andReturnUsing(function ($path, $contents) {
$contents = str_replace(["\r\n", "\r"], "\n", $contents);
$this->mockFilesystemOutput .= $contents;
return strlen($contents);