mirror of
https://github.com/amphp/parallel.git
synced 2025-07-18 12:01:24 +02:00
Provides parity with the behavior of ext-parallel and avoids potential hangs if stdio buffers fill.
21 lines
566 B
PHP
21 lines
566 B
PHP
<?php declare(strict_types=1);
|
|
|
|
namespace Amp\Parallel\Test\Context;
|
|
|
|
use Amp\Parallel\Context\Context;
|
|
use Amp\Parallel\Context\DefaultContextFactory;
|
|
use Amp\PHPUnit\AsyncTestCase;
|
|
|
|
class DefaultContextFactoryTest extends AsyncTestCase
|
|
{
|
|
public function testCreate(): void
|
|
{
|
|
$data = 'factory-test';
|
|
|
|
$factory = new DefaultContextFactory;
|
|
$context = $factory->start([__DIR__ . '/Fixtures/test-process.php', $data]);
|
|
self::assertInstanceOf(Context::class, $context);
|
|
self::assertSame($data, $context->join());
|
|
}
|
|
}
|