2017-12-06 01:21:39 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Amp\Parallel\Test\Context;
|
|
|
|
|
2020-02-11 17:38:30 +01:00
|
|
|
use Amp\Loop;
|
2019-02-18 06:50:41 +01:00
|
|
|
use Amp\Parallel\Context\Context;
|
2020-02-11 17:38:30 +01:00
|
|
|
use Amp\Parallel\Context\Internal\ProcessHub;
|
2017-12-06 01:21:39 +01:00
|
|
|
use Amp\Parallel\Context\Process;
|
|
|
|
|
2019-02-18 06:50:41 +01:00
|
|
|
class ProcessTest extends AbstractContextTest
|
2018-10-07 16:50:45 +02:00
|
|
|
{
|
2019-02-18 06:50:41 +01:00
|
|
|
public function createContext($script): Context
|
2018-10-07 16:50:45 +02:00
|
|
|
{
|
2020-02-11 17:38:30 +01:00
|
|
|
Loop::setState(Process::class, new ProcessHub(false)); // Manually set ProcessHub using socket server.
|
2019-02-18 06:50:41 +01:00
|
|
|
return new Process($script);
|
2019-01-09 17:25:30 +01:00
|
|
|
}
|
2017-12-06 01:21:39 +01:00
|
|
|
}
|