Add ScandalousTest
This commit is contained in:
28
tests/ScandalousTest.php
Normal file
28
tests/ScandalousTest.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Scandalous\Tests;
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Scandalous\Scandalous;
|
||||
use Scandalous\Contract\ProcessRunnerInterface;
|
||||
use Scandalous\Engine\LiteParseExtractor;
|
||||
|
||||
final class ScandalousTest extends TestCase
|
||||
{
|
||||
public function testExtractWithMockProcessRunner(): void
|
||||
{
|
||||
$mockRunner = $this->createMock(ProcessRunnerInterface::class);
|
||||
$mockRunner
|
||||
->expects($this->once())
|
||||
->method('run')
|
||||
->willReturn('Mock extracted text content');
|
||||
|
||||
$extractor = new LiteParseExtractor($mockRunner);
|
||||
$scandalous = new Scandalous($extractor);
|
||||
|
||||
$result = $scandalous->extract('path/to/pdffile.pdf');
|
||||
$this->assertSame('Mock extracted text content', $result);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user