1
0
Fork 0

ProcessExecutor - do not format output from executed processes

pull/8528/head
Ondrej Mirtes 2020-01-11 09:57:50 +01:00 committed by Jordi Boggiano
parent c5873e11f2
commit 7d4d4622ab
No known key found for this signature in database
GPG Key ID: 7BBD42C429EC80BC
1 changed files with 14 additions and 0 deletions

View File

@ -12,9 +12,14 @@
namespace Composer\Test\Util; namespace Composer\Test\Util;
use Composer\IO\ConsoleIO;
use Composer\Util\ProcessExecutor; use Composer\Util\ProcessExecutor;
use Composer\Test\TestCase; use Composer\Test\TestCase;
use Composer\IO\BufferIO; use Composer\IO\BufferIO;
use Symfony\Component\Console\Helper\HelperSet;
use Symfony\Component\Console\Input\ArrayInput;
use Symfony\Component\Console\Output\BufferedOutput;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Output\StreamOutput; use Symfony\Component\Console\Output\StreamOutput;
class ProcessExecutorTest extends TestCase class ProcessExecutorTest extends TestCase
@ -99,4 +104,13 @@ class ProcessExecutorTest extends TestCase
$this->assertEquals(array('foo', 'bar'), $process->splitLines("foo\r\nbar")); $this->assertEquals(array('foo', 'bar'), $process->splitLines("foo\r\nbar"));
$this->assertEquals(array('foo', 'bar'), $process->splitLines("foo\r\nbar\n")); $this->assertEquals(array('foo', 'bar'), $process->splitLines("foo\r\nbar\n"));
} }
public function testConsoleIODoesNotFormatSymfonyConsoleStyle()
{
$output = new BufferedOutput(OutputInterface::VERBOSITY_NORMAL, true);
$process = new ProcessExecutor(new ConsoleIO(new ArrayInput([]), $output, new HelperSet([])));
$process->execute('echo \'<error>foo</error>\'');
$this->assertSame('<error>foo</error>', $output->fetch());
}
} }