Upstream thephpleague/climate state of the touched files before e3f7e51a1a
This commit is contained in:
1 parent
06b3825ee5
commit
e65a9b267b
2 files changed
+1
-26
No files matched your search
@@ -87,29 +87,6 @@ class ManagerTest extends TestCase
|
||||
$this->assertEquals('', $this->manager->get('foo'));
|
||||
}
|
||||
|
||||
public function testItParsesAValueTakingArgumentThatIsLastWithoutAWarning()
|
||||
{
|
||||
$this->manager->add([
|
||||
'name' => ['prefix' => 'n', 'longPrefix' => 'name', 'defaultValue' => 'default-name'],
|
||||
]);
|
||||
|
||||
set_error_handler(static function (int $errno, string $errstr): bool {
|
||||
throw new \ErrorException($errstr, 0, $errno);
|
||||
});
|
||||
|
||||
try {
|
||||
// "-n" is the last element but not at a reindexed offset, so reading the
|
||||
// next offset must not raise "Undefined array key".
|
||||
$this->manager->parse(['command', 'somefile', '-n']);
|
||||
} finally {
|
||||
restore_error_handler();
|
||||
}
|
||||
|
||||
// No value was supplied for -n, so it must fall back to its default.
|
||||
$this->assertFalse($this->manager->provided('name'));
|
||||
$this->assertEquals('default-name', $this->manager->get('name'));
|
||||
}
|
||||
|
||||
public function testItStoresTrailingInArray()
|
||||
{
|
||||
$this->manager->add([
|
||||
|
||||
Reference in new issue
Block a user