More unittests
This commit is contained in:
27
tests/Pipe/PipelineTest.php
Normal file
27
tests/Pipe/PipelineTest.php
Normal file
@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
namespace Spark\Pipe;
|
||||
|
||||
|
||||
class PipelineTest extends \PhpUnit\Framework\TestCase
|
||||
{
|
||||
/**
|
||||
* @covers Pipeline::setInputFile
|
||||
* @covers Pipeline::setOutputFile
|
||||
* @covers Pipeline::run
|
||||
*/
|
||||
public function testPipingData()
|
||||
{
|
||||
|
||||
$rand = random_bytes(1024);
|
||||
file_put_contents("/tmp/rand.in", $rand);
|
||||
|
||||
$pipe = new Pipeline();
|
||||
$pipe->setInputFile("/tmp/rand.in");
|
||||
$pipe->setOutputFile("/tmp/rand.out");
|
||||
$pipe->run();
|
||||
|
||||
$out = file_get_contents("/tmp/rand.out");
|
||||
$this->assertEquals($rand, $out);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user