Laravel 5.6 updates
Travis config update Removed HHVM script as Laravel no longer support HHVM after releasing 5.3
This commit is contained in:
@@ -13,9 +13,7 @@ namespace Symfony\Component\Console\Tester;
|
||||
|
||||
use Symfony\Component\Console\Application;
|
||||
use Symfony\Component\Console\Input\ArrayInput;
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
||||
use Symfony\Component\Console\Output\ConsoleOutput;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
use Symfony\Component\Console\Output\StreamOutput;
|
||||
|
||||
/**
|
||||
@@ -30,13 +28,11 @@ use Symfony\Component\Console\Output\StreamOutput;
|
||||
*/
|
||||
class ApplicationTester
|
||||
{
|
||||
use TesterTrait;
|
||||
|
||||
private $application;
|
||||
private $input;
|
||||
private $statusCode;
|
||||
/**
|
||||
* @var OutputInterface
|
||||
*/
|
||||
private $output;
|
||||
private $captureStreamsIndependently = false;
|
||||
|
||||
public function __construct(Application $application)
|
||||
@@ -66,6 +62,13 @@ class ApplicationTester
|
||||
$this->input->setInteractive($options['interactive']);
|
||||
}
|
||||
|
||||
$shellInteractive = getenv('SHELL_INTERACTIVE');
|
||||
|
||||
if ($this->inputs) {
|
||||
$this->input->setStream(self::createStream($this->inputs));
|
||||
putenv('SHELL_INTERACTIVE=1');
|
||||
}
|
||||
|
||||
$this->captureStreamsIndependently = array_key_exists('capture_stderr_separately', $options) && $options['capture_stderr_separately'];
|
||||
if (!$this->captureStreamsIndependently) {
|
||||
$this->output = new StreamOutput(fopen('php://memory', 'w', false));
|
||||
@@ -97,27 +100,11 @@ class ApplicationTester
|
||||
$streamProperty->setValue($this->output, fopen('php://memory', 'w', false));
|
||||
}
|
||||
|
||||
return $this->statusCode = $this->application->run($this->input, $this->output);
|
||||
}
|
||||
$this->statusCode = $this->application->run($this->input, $this->output);
|
||||
|
||||
/**
|
||||
* Gets the display returned by the last execution of the application.
|
||||
*
|
||||
* @param bool $normalize Whether to normalize end of lines to \n or not
|
||||
*
|
||||
* @return string The display
|
||||
*/
|
||||
public function getDisplay($normalize = false)
|
||||
{
|
||||
rewind($this->output->getStream());
|
||||
putenv($shellInteractive ? "SHELL_INTERACTIVE=$shellInteractive" : 'SHELL_INTERACTIVE');
|
||||
|
||||
$display = stream_get_contents($this->output->getStream());
|
||||
|
||||
if ($normalize) {
|
||||
$display = str_replace(PHP_EOL, "\n", $display);
|
||||
}
|
||||
|
||||
return $display;
|
||||
return $this->statusCode;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -143,34 +130,4 @@ class ApplicationTester
|
||||
|
||||
return $display;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the input instance used by the last execution of the application.
|
||||
*
|
||||
* @return InputInterface The current input instance
|
||||
*/
|
||||
public function getInput()
|
||||
{
|
||||
return $this->input;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the output instance used by the last execution of the application.
|
||||
*
|
||||
* @return OutputInterface The current output instance
|
||||
*/
|
||||
public function getOutput()
|
||||
{
|
||||
return $this->output;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the status code returned by the last execution of the application.
|
||||
*
|
||||
* @return int The status code
|
||||
*/
|
||||
public function getStatusCode()
|
||||
{
|
||||
return $this->statusCode;
|
||||
}
|
||||
}
|
||||
|
81
vendor/symfony/console/Tester/CommandTester.php
vendored
81
vendor/symfony/console/Tester/CommandTester.php
vendored
@@ -13,8 +13,6 @@ namespace Symfony\Component\Console\Tester;
|
||||
|
||||
use Symfony\Component\Console\Command\Command;
|
||||
use Symfony\Component\Console\Input\ArrayInput;
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
use Symfony\Component\Console\Output\StreamOutput;
|
||||
|
||||
/**
|
||||
@@ -25,10 +23,10 @@ use Symfony\Component\Console\Output\StreamOutput;
|
||||
*/
|
||||
class CommandTester
|
||||
{
|
||||
use TesterTrait;
|
||||
|
||||
private $command;
|
||||
private $input;
|
||||
private $output;
|
||||
private $inputs = array();
|
||||
private $statusCode;
|
||||
|
||||
public function __construct(Command $command)
|
||||
@@ -78,79 +76,4 @@ class CommandTester
|
||||
|
||||
return $this->statusCode = $this->command->run($this->input, $this->output);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the display returned by the last execution of the command.
|
||||
*
|
||||
* @param bool $normalize Whether to normalize end of lines to \n or not
|
||||
*
|
||||
* @return string The display
|
||||
*/
|
||||
public function getDisplay($normalize = false)
|
||||
{
|
||||
rewind($this->output->getStream());
|
||||
|
||||
$display = stream_get_contents($this->output->getStream());
|
||||
|
||||
if ($normalize) {
|
||||
$display = str_replace(PHP_EOL, "\n", $display);
|
||||
}
|
||||
|
||||
return $display;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the input instance used by the last execution of the command.
|
||||
*
|
||||
* @return InputInterface The current input instance
|
||||
*/
|
||||
public function getInput()
|
||||
{
|
||||
return $this->input;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the output instance used by the last execution of the command.
|
||||
*
|
||||
* @return OutputInterface The current output instance
|
||||
*/
|
||||
public function getOutput()
|
||||
{
|
||||
return $this->output;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the status code returned by the last execution of the application.
|
||||
*
|
||||
* @return int The status code
|
||||
*/
|
||||
public function getStatusCode()
|
||||
{
|
||||
return $this->statusCode;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the user inputs.
|
||||
*
|
||||
* @param array $inputs An array of strings representing each input
|
||||
* passed to the command input stream
|
||||
*
|
||||
* @return CommandTester
|
||||
*/
|
||||
public function setInputs(array $inputs)
|
||||
{
|
||||
$this->inputs = $inputs;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
private static function createStream(array $inputs)
|
||||
{
|
||||
$stream = fopen('php://memory', 'r+', false);
|
||||
|
||||
fwrite($stream, implode(PHP_EOL, $inputs));
|
||||
rewind($stream);
|
||||
|
||||
return $stream;
|
||||
}
|
||||
}
|
||||
|
103
vendor/symfony/console/Tester/TesterTrait.php
vendored
Normal file
103
vendor/symfony/console/Tester/TesterTrait.php
vendored
Normal file
@@ -0,0 +1,103 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\Console\Tester;
|
||||
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
use Symfony\Component\Console\Output\StreamOutput;
|
||||
|
||||
/**
|
||||
* @author Amrouche Hamza <hamza.simperfit@gmail.com>
|
||||
*
|
||||
* @internal
|
||||
*/
|
||||
trait TesterTrait
|
||||
{
|
||||
/** @var StreamOutput */
|
||||
private $output;
|
||||
private $inputs = array();
|
||||
|
||||
/**
|
||||
* Gets the display returned by the last execution of the command or application.
|
||||
*
|
||||
* @param bool $normalize Whether to normalize end of lines to \n or not
|
||||
*
|
||||
* @return string The display
|
||||
*/
|
||||
public function getDisplay($normalize = false)
|
||||
{
|
||||
rewind($this->output->getStream());
|
||||
|
||||
$display = stream_get_contents($this->output->getStream());
|
||||
|
||||
if ($normalize) {
|
||||
$display = str_replace(PHP_EOL, "\n", $display);
|
||||
}
|
||||
|
||||
return $display;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the input instance used by the last execution of the command or application.
|
||||
*
|
||||
* @return InputInterface The current input instance
|
||||
*/
|
||||
public function getInput()
|
||||
{
|
||||
return $this->input;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the output instance used by the last execution of the command or application.
|
||||
*
|
||||
* @return OutputInterface The current output instance
|
||||
*/
|
||||
public function getOutput()
|
||||
{
|
||||
return $this->output;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the status code returned by the last execution of the command or application.
|
||||
*
|
||||
* @return int The status code
|
||||
*/
|
||||
public function getStatusCode()
|
||||
{
|
||||
return $this->statusCode;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the user inputs.
|
||||
*
|
||||
* @param $inputs array An array of strings representing each input
|
||||
* passed to the command input stream
|
||||
*
|
||||
* @return self
|
||||
*/
|
||||
public function setInputs(array $inputs)
|
||||
{
|
||||
$this->inputs = $inputs;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
private static function createStream(array $inputs)
|
||||
{
|
||||
$stream = fopen('php://memory', 'r+', false);
|
||||
|
||||
fwrite($stream, implode(PHP_EOL, $inputs));
|
||||
rewind($stream);
|
||||
|
||||
return $stream;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user