Laravel version update

Laravel version update
This commit is contained in:
Manish Verma
2018-08-06 18:48:58 +05:30
parent d143048413
commit 126fbb0255
13678 changed files with 1031482 additions and 778530 deletions

View File

@@ -11,12 +11,13 @@
namespace Symfony\Component\Console\Tests\Input;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Console\Input\ArrayInput;
use Symfony\Component\Console\Input\InputDefinition;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputDefinition;
use Symfony\Component\Console\Input\InputOption;
class ArrayInputTest extends \PHPUnit_Framework_TestCase
class ArrayInputTest extends TestCase
{
public function testGetFirstArgument()
{
@@ -46,14 +47,14 @@ class ArrayInputTest extends \PHPUnit_Framework_TestCase
{
$input = new ArrayInput(array('name' => 'Fabien', '--foo' => 'bar'));
$this->assertEquals('bar', $input->getParameterOption('--foo'), '->getParameterOption() returns the option of specified name');
$this->assertFalse($input->getParameterOption('--bar'), '->getParameterOption() returns the default if an option is not present in the passed parameters');
$this->assertEquals('default', $input->getParameterOption('--bar', 'default'), '->getParameterOption() returns the default value if an option is not present in the passed parameters');
$input = new ArrayInput(array('Fabien', '--foo' => 'bar'));
$this->assertEquals('bar', $input->getParameterOption('--foo'), '->getParameterOption() returns the option of specified name');
$input = new ArrayInput(array('--foo', '--', '--bar' => 'woop'));
$this->assertEquals('woop', $input->getParameterOption('--bar'), '->getParameterOption() returns the correct value if an option is present in the passed parameters');
$this->assertFalse($input->getParameterOption('--bar', false, true), '->getParameterOption() returns false if an option is present in the passed parameters after an end of options signal');
$this->assertEquals('default', $input->getParameterOption('--bar', 'default', true), '->getParameterOption() returns the default value if an option is present in the passed parameters after an end of options signal');
}
public function testParseArguments()
@@ -89,9 +90,15 @@ class ArrayInputTest extends \PHPUnit_Framework_TestCase
'->parse() parses long options with a default value',
),
array(
array('--foo' => null),
array(),
array(new InputOption('foo', 'f', InputOption::VALUE_OPTIONAL, '', 'default')),
array('foo' => 'default'),
'->parse() uses the default value for long options with value optional which are not passed',
),
array(
array('--foo' => null),
array(new InputOption('foo', 'f', InputOption::VALUE_OPTIONAL, '', 'default')),
array('foo' => null),
'->parse() parses long options with a default value',
),
array(
@@ -120,7 +127,12 @@ class ArrayInputTest extends \PHPUnit_Framework_TestCase
*/
public function testParseInvalidInput($parameters, $definition, $expectedExceptionMessage)
{
$this->setExpectedException('InvalidArgumentException', $expectedExceptionMessage);
if (method_exists($this, 'expectException')) {
$this->expectException('InvalidArgumentException');
$this->expectExceptionMessage($expectedExceptionMessage);
} else {
$this->setExpectedException('InvalidArgumentException', $expectedExceptionMessage);
}
new ArrayInput($parameters, $definition);
}
@@ -155,5 +167,11 @@ class ArrayInputTest extends \PHPUnit_Framework_TestCase
{
$input = new ArrayInput(array('-f' => null, '-b' => 'bar', '--foo' => 'b a z', '--lala' => null, 'test' => 'Foo', 'test2' => "A\nB'C"));
$this->assertEquals('-f -b=bar --foo='.escapeshellarg('b a z').' --lala Foo '.escapeshellarg("A\nB'C"), (string) $input);
$input = new ArrayInput(array('-b' => array('bval_1', 'bval_2'), '--f' => array('fval_1', 'fval_2')));
$this->assertSame('-b=bval_1 -b=bval_2 --f=fval_1 --f=fval_2', (string) $input);
$input = new ArrayInput(array('array_arg' => array('val_1', 'val_2')));
$this->assertSame('val_1 val_2', (string) $input);
}
}