mirror of
https://github.com/Intervention/image.git
synced 2025-08-29 00:29:55 +02:00
bugfix
This commit is contained in:
@@ -52,8 +52,10 @@ class Argument
|
|||||||
$arguments = $this->command->arguments;
|
$arguments = $this->command->arguments;
|
||||||
|
|
||||||
if (is_array($arguments)) {
|
if (is_array($arguments)) {
|
||||||
return array_key_exists($this->key, $arguments) ? $arguments[$this->key] : $default;
|
return isset($arguments[$this->key]) ? $arguments[$this->key] : $default;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return $default;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -397,6 +397,17 @@ class ArgumentTest extends PHPUnit_Framework_TestCase
|
|||||||
$arg->max(10);
|
$arg->max(10);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function testValueDefault()
|
||||||
|
{
|
||||||
|
$arg = new Argument($this->getMockedCommand());
|
||||||
|
$value = $arg->value('foo');
|
||||||
|
$this->assertEquals('foo', $value);
|
||||||
|
|
||||||
|
$arg = new Argument($this->getMockedCommand(array(null)));
|
||||||
|
$value = $arg->value('foo');
|
||||||
|
$this->assertEquals('foo', $value);
|
||||||
|
}
|
||||||
|
|
||||||
private function validateArgument($argument, $value)
|
private function validateArgument($argument, $value)
|
||||||
{
|
{
|
||||||
$this->assertInstanceOf('\Intervention\Image\Commands\Argument', $argument);
|
$this->assertInstanceOf('\Intervention\Image\Commands\Argument', $argument);
|
||||||
|
Reference in New Issue
Block a user