404

[ Avaa Bypassed ]




Upload:

Command:

botdev@3.17.6.129: ~ $
<?php namespace thiagoalessio\TesseractOCR\Tests\Unit;

use thiagoalessio\TesseractOCR\Tests\Common\TestCase;
use thiagoalessio\TesseractOCR\Command;

class OutputFileTest extends TestCase
{
	public function beforeEach()
	{
		$this->cmd = new Command('image', '/path/to/output/file');
	}

	public function testTxt()
	{
		foreach (array('digits', 'quiet', 'txt', 'anything', 'else') as $ext) {
			$this->cmd->configFile = $ext;
			$expected = "/path/to/output/file.txt";
			$this->assertEquals($expected, $this->cmd->getOutputFile());
		}
	}

	public function testHocr()
	{
		$this->cmd->configFile = 'hocr';
		$expected = '/path/to/output/file.hocr';
		$this->assertEquals($expected, $this->cmd->getOutputFile());
	}

	public function testTsv()
	{
		$this->cmd->configFile = 'tsv';
		$expected = '/path/to/output/file.tsv';
		$this->assertEquals($expected, $this->cmd->getOutputFile());
	}

	public function testPdf()
	{
		$this->cmd->configFile = 'pdf';
		$expected = '/path/to/output/file.pdf';
		$this->assertEquals($expected, $this->cmd->getOutputFile());
	}
}

Filemanager

Name Type Size Permission Actions
CommandTest.php File 2.46 KB 0755
OptionTest.php File 3.26 KB 0755
OutputFileTest.php File 1.04 KB 0755
TesseractOCRTest.php File 6.13 KB 0755
TestableCommand.php File 342 B 0755