php-spark/tests/Pipe/PipelineTest.php

28 lines
597 B
PHP
Raw Permalink Normal View History

2021-12-23 14:44:02 +00:00
<?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);
}
}