chubbyphp/chubbyphp-socket-server-mock

此包已被废弃,不再维护。未建议替代包。

Chubbyphp Socket Server Mock

1.2.0 2020-08-18 19:44 UTC

This package is auto-updated.

Last update: 2020-09-22 18:56:53 UTC


README

Build Status Coverage Status Latest Stable Version Total Downloads Monthly Downloads Daily Downloads

描述

简单的套接字服务器模拟。

要求

  • php: ^7.2
  • symfony/process: ^3.4.43|^4.4.11|^5.0

安装

通过 Composerchubbyphp/chubbyphp-socket-server-mock 的形式。

composer require chubbyphp/chubbyphp-socket-server-mock "^1.2"

用法

<?php

namespace MyProject\Tests\Integration;

use Chubbyphp\SocketServerMock\CreateSocketServerMockTrait;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Process\Process;

final class SampleTest extends TestCase
{
    use CreateSocketServerMockTrait;

    public function testSample()
    {
        /** @var Process $process */
        $process = $this->createSocketServerMock('0.0.0.0', 3000, [[[
            'input' => 'input',
            'output' => 'output'
        ]]]);

        // run my integration test
    }
}

版权

多米尼克·佐格 2020