Upgrade 1-11.38

This commit is contained in:
xesmyd
2026-03-30 14:10:30 +02:00
parent f2a7e6d1fc
commit ac648ef29d
24665 changed files with 69682 additions and 2205004 deletions
+25 -23
View File
@@ -24,10 +24,12 @@ class InputOptionTest extends TestCase
$this->assertEquals('foo', $option->getName(), '__construct() removes the leading -- of the option name');
}
/**
* @expectedException \InvalidArgumentException
* @expectedExceptionMessage Impossible to have an option mode VALUE_IS_ARRAY if the option does not accept a value.
*/
public function testArrayModeWithoutValue()
{
$this->expectException('InvalidArgumentException');
$this->expectExceptionMessage('Impossible to have an option mode VALUE_IS_ARRAY if the option does not accept a value.');
new InputOption('foo', 'f', InputOption::VALUE_IS_ARRAY);
}
@@ -72,39 +74,35 @@ class InputOptionTest extends TestCase
}
/**
* @dataProvider provideInvalidModes
* @expectedException \InvalidArgumentException
* @expectedExceptionMessage Option mode "-1" is not valid.
*/
public function testInvalidModes($mode)
public function testInvalidModes()
{
$this->expectException('InvalidArgumentException');
$this->expectExceptionMessage(sprintf('Option mode "%s" is not valid.', $mode));
new InputOption('foo', 'f', $mode);
}
public function provideInvalidModes()
{
return [
['ANOTHER_ONE'],
[-1],
];
new InputOption('foo', 'f', '-1');
}
/**
* @expectedException \InvalidArgumentException
*/
public function testEmptyNameIsInvalid()
{
$this->expectException('InvalidArgumentException');
new InputOption('');
}
/**
* @expectedException \InvalidArgumentException
*/
public function testDoubleDashNameIsInvalid()
{
$this->expectException('InvalidArgumentException');
new InputOption('--');
}
/**
* @expectedException \InvalidArgumentException
*/
public function testSingleDashOptionIsInvalid()
{
$this->expectException('InvalidArgumentException');
new InputOption('foo', '-');
}
@@ -153,18 +151,22 @@ class InputOptionTest extends TestCase
$this->assertEquals([1, 2], $option->getDefault(), '->setDefault() changes the default value');
}
/**
* @expectedException \LogicException
* @expectedExceptionMessage Cannot set a default value when using InputOption::VALUE_NONE mode.
*/
public function testDefaultValueWithValueNoneMode()
{
$this->expectException('LogicException');
$this->expectExceptionMessage('Cannot set a default value when using InputOption::VALUE_NONE mode.');
$option = new InputOption('foo', 'f', InputOption::VALUE_NONE);
$option->setDefault('default');
}
/**
* @expectedException \LogicException
* @expectedExceptionMessage A default value for an array option must be an array.
*/
public function testDefaultValueWithIsArrayMode()
{
$this->expectException('LogicException');
$this->expectExceptionMessage('A default value for an array option must be an array.');
$option = new InputOption('foo', 'f', InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY);
$option->setDefault('default');
}