chubbyphp/chubbyphp-socket-server-mock

Chubbyphp Socket Server Mock

1.1.2 2020-01-06 05:20 UTC

This package is auto-updated.

Last update: 2020-06-26 06:24:04 UTC


README

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

Description

A simple socket server mock.

Requirements

  • php: ^7.0
  • symfony/process: ^2.8.50|^3.4.26|^4.2.7|^5.0

Installation

Through Composer as chubbyphp/chubbyphp-socket-server-mock.

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

Usage

<?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
    }
}

Copyright

Dominik Zogg 2020