Add pear modules, mail and net_smtp via composer (#93)
Add pear modules, mail and net_smtp via composer, remove php 5.6 build due to phpunit 6
This commit is contained in:
@@ -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\InputOption;
|
||||
|
||||
class ArrayInputTest extends \PHPUnit_Framework_TestCase
|
||||
class ArrayInputTest extends TestCase
|
||||
{
|
||||
public function testGetFirstArgument()
|
||||
{
|
||||
@@ -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,8 @@ 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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user