A simple socket server mock.
- php: ^7.2
- symfony/process: ^3.4.43|^4.4.11|^5.0
Through Composer as chubbyphp/chubbyphp-socket-server-mock.
composer require chubbyphp/chubbyphp-socket-server-mock "^1.2"<?phpnamespaceMyProject\Tests\Integration;
useChubbyphp\SocketServerMock\CreateSocketServerMockTrait;
usePHPUnit\Framework\TestCase;
useSymfony\Component\Process\Process;
finalclass SampleTest extends TestCase
{
use CreateSocketServerMockTrait;
publicfunctiontestSample()
{
/** @var Process $process */$process = $this->createSocketServerMock('0.0.0.0', 3000, [[[
'input' => 'input',
'output' => 'output'
]]]);
// run my integration test
}
}Dominik Zogg 2020


