test pdf use case
This commit is contained in:
parent
208c683dac
commit
b1bee8a16e
3 changed files with 165 additions and 0 deletions
30
backend/tests/Fakes/FakeStoredFileReader.php
Normal file
30
backend/tests/Fakes/FakeStoredFileReader.php
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
<?php
|
||||
|
||||
namespace Tests\Fakes;
|
||||
|
||||
use App\Shared\Files\StoredFileReader;
|
||||
|
||||
class FakeStoredFileReader implements StoredFileReader
|
||||
{
|
||||
/**
|
||||
* @var array<string, string>
|
||||
*/
|
||||
private array $filesByPath = [];
|
||||
|
||||
/**
|
||||
* @var string[]
|
||||
*/
|
||||
public array $readPaths = [];
|
||||
|
||||
public function put(string $path, string $contents): void
|
||||
{
|
||||
$this->filesByPath[$path] = $contents;
|
||||
}
|
||||
|
||||
public function read(string $path): ?string
|
||||
{
|
||||
$this->readPaths[] = $path;
|
||||
|
||||
return $this->filesByPath[$path] ?? null;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue