Skip to content
This repository has been archived by the owner on Sep 23, 2020. It is now read-only.

Latest commit

 

History

History
60 lines (41 loc) · 1.98 KB

README.md

File metadata and controls

60 lines (41 loc) · 1.98 KB

chubbyphp-socket-server-mock

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

Description

A simple socket server mock.

Requirements

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

Installation

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

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

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