mirror of
https://github.com/linuxserver/Heimdall.git
synced 2025-12-03 13:40:00 +09:00
Dependency updates and update version number
This commit is contained in:
@@ -314,6 +314,10 @@ class ArgvInputTest extends TestCase
|
||||
$input = new ArgvInput(array('cli.php', '-f', 'foo'));
|
||||
$this->assertTrue($input->hasParameterOption('-f'), '->hasParameterOption() returns true if the given short option is in the raw input');
|
||||
|
||||
$input = new ArgvInput(array('cli.php', '-etest'));
|
||||
$this->assertTrue($input->hasParameterOption('-e'), '->hasParameterOption() returns true if the given short option is in the raw input');
|
||||
$this->assertFalse($input->hasParameterOption('-s'), '->hasParameterOption() returns true if the given short option is in the raw input');
|
||||
|
||||
$input = new ArgvInput(array('cli.php', '--foo', 'foo'));
|
||||
$this->assertTrue($input->hasParameterOption('--foo'), '->hasParameterOption() returns true if the given short option is in the raw input');
|
||||
|
||||
@@ -339,6 +343,46 @@ class ArgvInputTest extends TestCase
|
||||
$this->assertFalse($input->hasParameterOption('--foo', true), '->hasParameterOption() returns false if the given option is in the raw input but after an end of options signal');
|
||||
}
|
||||
|
||||
public function testHasParameterOptionEdgeCasesAndLimitations()
|
||||
{
|
||||
$input = new ArgvInput(array('cli.php', '-fh'));
|
||||
// hasParameterOption does not know if the previous short option, -f,
|
||||
// takes a value or not. If -f takes a value, then -fh does NOT include
|
||||
// -h; Otherwise it does. Since we do not know which short options take
|
||||
// values, hasParameterOption does not support this use-case.
|
||||
$this->assertFalse($input->hasParameterOption('-h'), '->hasParameterOption() returns true if the given short option is in the raw input');
|
||||
// hasParameterOption does detect that `-fh` contains `-f`, since
|
||||
// `-f` is the first short option in the set.
|
||||
$this->assertTrue($input->hasParameterOption('-f'), '->hasParameterOption() returns true if the given short option is in the raw input');
|
||||
// The test below happens to pass, although it might make more sense
|
||||
// to disallow it, and require the use of
|
||||
// $input->hasParameterOption('-f') && $input->hasParameterOption('-h')
|
||||
// instead.
|
||||
$this->assertTrue($input->hasParameterOption('-fh'), '->hasParameterOption() returns true if the given short option is in the raw input');
|
||||
// In theory, if -fh is supported, then -hf should also work.
|
||||
// However, this is not supported.
|
||||
$this->assertFalse($input->hasParameterOption('-hf'), '->hasParameterOption() returns true if the given short option is in the raw input');
|
||||
|
||||
$input = new ArgvInput(array('cli.php', '-f', '-h'));
|
||||
// If hasParameterOption('-fh') is supported for 'cli.php -fh', then
|
||||
// one might also expect that it should also be supported for
|
||||
// 'cli.php -f -h'. However, this is not supported.
|
||||
$this->assertFalse($input->hasParameterOption('-fh'), '->hasParameterOption() returns true if the given short option is in the raw input');
|
||||
}
|
||||
|
||||
public function testNoWarningOnInvalidParameterOption()
|
||||
{
|
||||
$input = new ArgvInput(array('cli.php', '-edev'));
|
||||
|
||||
$this->assertTrue($input->hasParameterOption(array('-e', '')));
|
||||
// No warning thrown
|
||||
$this->assertFalse($input->hasParameterOption(array('-m', '')));
|
||||
|
||||
$this->assertEquals('dev', $input->getParameterOption(array('-e', '')));
|
||||
// No warning thrown
|
||||
$this->assertFalse($input->getParameterOption(array('-m', '')));
|
||||
}
|
||||
|
||||
public function testToString()
|
||||
{
|
||||
$input = new ArgvInput(array('cli.php', '-f', 'foo'));
|
||||
|
||||
Reference in New Issue
Block a user