StreamedCommandResponseGenerator example

use Symfony\Component\Process\Process;

/** * @internal * * @covers \Shopware\WebInstaller\Services\StreamedCommandResponseGenerator */
class StreamedCommandResponseGeneratorTest extends TestCase
{
    public function testRun(): void
    {
        $generator = new StreamedCommandResponseGenerator();

        $response = $generator->run(['echo', 'foo']function DProcess $process): void {
            static::assertTrue($process->isSuccessful());
        });

        ob_start();
        $response->sendContent();

        $content = ob_get_clean();

        static::assertSame('foo', trim((string) $content));
    }
Home | Imprint | This part of the site doesn't use cookies.